Skip to content
Merged
2 changes: 1 addition & 1 deletion Array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ void Array::print_decl(FILE *out, string space, bool print_semi, bool constraint
constrained, and FALSE otherwise.
*/
void Array::print_decl(ostream &out, string space, bool print_semi, bool constraint_info, bool constrained,
bool is_root_grp, bool array_member) {
bool is_root_grp, bool) {
if (constrained && !send_p())
return;

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ set(DAP4_ONLY_SRC
D4ParserSax2.cc D4BaseTypeFactory.cc D4Dimensions.cc D4EnumDefs.cc D4Group.cc
DMR.cc D4Attributes.cc D4Enum.cc chunked_ostream.cc chunked_istream.cc
D4Sequence.cc D4Maps.cc D4Opaque.cc D4AsyncUtil.cc D4RValue.cc D4FilterClause.cc
diagnostic_suppression.h
)

set(CLIENT_SRC RCReader.cc Connect.cc D4Connect.cc util_mit.cc)
Expand Down
2 changes: 1 addition & 1 deletion D4Enum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void D4Enum::m_duplicate(const D4Enum &src) {
*
* @param attr AttrTable pointer, ignored by this method.
*/
std::vector<BaseType *> *D4Enum::transform_to_dap2(AttrTable *, bool show_shared_dims) {
std::vector<BaseType *> *D4Enum::transform_to_dap2(AttrTable *, bool) {
BaseType *btp;

DBG(cerr << __func__ << "() - BEGIN" << endl;);
Expand Down
6 changes: 1 addition & 5 deletions D4Opaque.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ bool D4Opaque::set_value(const dods_opaque &value) {
@return The value. */
D4Opaque::dods_opaque D4Opaque::value() const { return d_buf; }

std::vector<BaseType *> *D4Opaque::transform_to_dap2(AttrTable *, bool show_shared_dims) {

DBG(cerr << __func__ << "() - Transform not implemented DAP4 Opaque type." << endl;);
return NULL;
}
std::vector<BaseType *> *D4Opaque::transform_to_dap2(AttrTable *, bool) { return nullptr; }

void D4Opaque::print_val(ostream &out, string space, bool print_decl_p, bool is_root_grp) {
if (print_decl_p)
Expand Down
2 changes: 1 addition & 1 deletion D4Sequence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ void D4Sequence::print_val_by_rows(ostream &out, string space, bool print_decl_p
out << ";\n";
}

void D4Sequence::print_val(ostream &out, string space, bool print_decl_p, bool is_root_grp) {
void D4Sequence::print_val(ostream &out, string space, bool print_decl_p, bool) {
DBG(cerr << name() << " isa " << type_name() << endl);

print_val_by_rows(out, space, print_decl_p, false);
Expand Down
22 changes: 1 addition & 21 deletions Int64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@
#include "UInt64.h"
#include "Url.h"

#if 0
#include "Array.h"
#include "Grid.h"
#include "Sequence.h"
#include "Structure.h"
#endif

#include "D4StreamMarshaller.h"
#include "D4StreamUnMarshaller.h"
#include "DMR.h"
Expand Down Expand Up @@ -211,20 +204,7 @@ bool Int64::d4_ops(BaseType *b, int op) {
*
* @return A pointer to the transformed variable
*/
std::vector<BaseType *> *Int64::transform_to_dap2(AttrTable *, bool show_shared_dims) {
#if 0
BaseType *dest = this->ptr_duplicate();
// convert the d4 attributes to a dap2 attribute table.
AttrTable *attrs = this->attributes()->get_AttrTable();
attrs->set_name(name());
dest->set_attr_table(*attrs);
dest->set_is_dap4(false);
// attrs->print(cerr,"",true);
return dest;
#endif

return NULL;
}
std::vector<BaseType *> *Int64::transform_to_dap2(AttrTable *, bool) { return nullptr; }

/**
* When send_p() is true a description of the instance is added to the inventory and true is returned.
Expand Down
2 changes: 1 addition & 1 deletion Int8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ bool Int8::d4_ops(BaseType *b, int op) {
*
* @return A pointer to the transformed variable
*/
std::vector<BaseType *> *Int8::transform_to_dap2(AttrTable *parent_attr_table, bool show_shared_dims) {
std::vector<BaseType *> *Int8::transform_to_dap2(AttrTable *parent_attr_table, bool) {
vector<BaseType *> *vec = BaseType::transform_to_dap2(parent_attr_table);
if (vec->size() != 1) {
ostringstream oss;
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ DAP_HDR = AttrTable.h DAS.h DDS.h DataDDS.h DDXParserSAX2.h \
Grid.h UInt32.h Int16.h UInt16.h Float32.h BaseTypeFactory.h \
ObjectType.h EncodingType.h SignalHandler.h Error.h \
InternalErr.h util.h escaping.h parser.h debug.h dods-limits.h \
dods-datatypes.h Type.h \
dods-datatypes.h Type.h diagnostic_suppression.h \
util_mit.h expr.h Clause.h RValue.h ConstraintEvaluator.h \
ce_parser.h DapIndent.h DapObj.h XDRFileMarshaller.h \
Marshaller.h UnMarshaller.h XDRFileUnMarshaller.h \
Expand Down
4 changes: 2 additions & 2 deletions Sequence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1109,11 +1109,11 @@ void Sequence::print_val_by_rows(ostream &out, string space, bool print_decl_p,
out << ";\n";
}

void Sequence::print_val(FILE *out, string space, bool print_decl_p, bool is_root_grp) {
void Sequence::print_val(FILE *out, string space, bool print_decl_p, bool) {
print_val_by_rows(out, space, print_decl_p, false);
}

void Sequence::print_val(ostream &out, string space, bool print_decl_p, bool is_root_grp) {
void Sequence::print_val(ostream &out, string space, bool print_decl_p, bool) {
print_val_by_rows(out, space, print_decl_p, false);
}

Expand Down
4 changes: 2 additions & 2 deletions Sequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ class Sequence : public Constructor {
sequence_values_stack_t &sequence_values_stack);

public:
Sequence(const string &n);
explicit Sequence(const string &n);
Sequence(const string &n, const string &d);

Sequence(const Sequence &rhs);

virtual ~Sequence();
~Sequence() override;

Sequence &operator=(const Sequence &rhs);

Expand Down
4 changes: 2 additions & 2 deletions UInt32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ bool UInt32::ops(BaseType *b, int op) {
// Since the read method is virtual and implemented outside
// libdap++ if we cannot read the data that is the problem
// of the user or of whoever wrote the surrogate library
// implemeting read therefore it is an internal error.
// implementing read, therefore, it is an internal error.
throw InternalErr(__FILE__, __LINE__, "This value was not read!");
}

Expand All @@ -209,7 +209,7 @@ bool UInt32::ops(BaseType *b, int op) {
// Since the read method is virtual and implemented outside
// libdap++ if we cannot read the data that is the problem
// of the user or of whoever wrote the surrogate library
// implemeting read therefore it is an internal error.
// implementing read, therefore, it is an internal error.
throw InternalErr(__FILE__, __LINE__, "This value was not read!");
}

Expand Down
16 changes: 1 addition & 15 deletions UInt64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,7 @@ bool UInt64::d4_ops(BaseType *b, int op) {
*
* @return A pointer to the transformed variable
*/
std::vector<BaseType *> *UInt64::transform_to_dap2(AttrTable *, bool show_shared_dims) {

#if 0
BaseType *dest = this->ptr_duplicate();
// convert the d4 attributes to a dap2 attribute table.
AttrTable *attrs = this->attributes()->get_AttrTable();
attrs->set_name(name());
dest->set_attr_table(*attrs);
dest->set_is_dap4(false);
// attrs->print(cerr,"",true);
return dest;
#endif

return NULL;
}
std::vector<BaseType *> *UInt64::transform_to_dap2(AttrTable *, bool) { return nullptr; }

/**
* When send_p() is true a description of the instance is added to the inventory and true is returned.
Expand Down
7 changes: 4 additions & 3 deletions XDRUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "Str.h"
#include "XDRUtils.h"
#include "debug.h"
#include "diagnostic_suppression.h"

using namespace libdap;

Expand Down Expand Up @@ -135,7 +136,7 @@ namespace libdap {
@return A C function used to encode data in the XDR format.
*/
xdrproc_t XDRUtils::xdr_coder(const Type &t) {
switch (t) {
A_cast_function_type_mismatch switch (t) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found "A_cast_function_type_mismatch" is defined at diagnostic_supporession.h
as ```
#define A_cast_function_type_mismatch
It is not obvious what it is doing. Could you add a comment to explain what it is doing or point to diagnostic_suppression.h for further reference.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I'll do that.

case dods_int16_c:
return reinterpret_cast<xdrproc_t>(XDR_INT16);
case dods_uint16_c:
Expand All @@ -148,6 +149,7 @@ xdrproc_t XDRUtils::xdr_coder(const Type &t) {
return reinterpret_cast<xdrproc_t>(XDR_FLOAT32);
case dods_float64_c:
return reinterpret_cast<xdrproc_t>(XDR_FLOAT64);

case dods_byte_c:
case dods_str_c:
case dods_url_c:
Expand All @@ -158,8 +160,7 @@ xdrproc_t XDRUtils::xdr_coder(const Type &t) {
default:
break;
}

return NULL;
A_Pop return nullptr;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as the above for A_pop.

}

} // namespace libdap
27 changes: 27 additions & 0 deletions diagnostic_suppression.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// Created by James Gallagher on 1/26/26.
//

#ifndef LIBDAP_DIAGNOSTIC_SUPPRESSION_H
#define LIBDAP_DIAGNOSTIC_SUPPRESSION_H

// Define a macro for convenience. To keep things simple, use a macro for
// each kind of warning. There should be few uses of this. jhrg 1/26/26
//
// Based on https://nelkinda.com/blog/suppress-warnings-in-gcc-and-clang/

#ifdef __GNUC__

#define A_cast_function_type_mismatch \
_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wcast-function-type-mismatch\"")

#define A_Pop _Pragma("GCC diagnostic pop")

#else
// Define them empty for other compilers (e.g., MSVC) if needed

#define A_IgnoreUnused
#define A_Pop
#endif

#endif // LIBDAP_DIAGNOSTIC_SUPPRESSION_H
Loading