diff --git a/CMakeLists.txt b/CMakeLists.txt index 81a36e8..b35cde2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,8 @@ add_compile_options(-std=c++14 -Wuninitialized -Wconversion -Wno-missing-field-initializers - -Wno-unused-parameter) + -Wno-unused-parameter + -Wno-gnu-zero-variadic-macro-arguments) # Use shared libraries in this project set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++") diff --git a/msi_http_send_file/msi_http_send_file.cpp b/msi_http_send_file/msi_http_send_file.cpp index b6ca098..3d0d2f2 100644 --- a/msi_http_send_file/msi_http_send_file.cpp +++ b/msi_http_send_file/msi_http_send_file.cpp @@ -104,8 +104,7 @@ class irodsCurl { dataObjInp_t file; openedDataObjInp_t openedFile; bytesBuf_t bytesBuf; - - size_t bytesRead; + int bytesRead; // Make sure we have something to read from if (!readData) { @@ -140,16 +139,15 @@ class irodsCurl { openedFile.l1descInx = readData->desc; openedFile.len = bytesBuf.len; - // bytesRead = 0; - //TODO: At Paul: during compilation warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') + // Read iRODS object bytesRead = rsDataObjRead(readData->rsComm, &openedFile, &bytesBuf); - //TODO: At Paul: during compilation warning: comparison of unsigned expression < 0 is always false + if (bytesRead < 0) { rodsLog(LOG_ERROR, "irods_http_send_file: Problem reading iRODS object. Status = %d", bytesRead); return CURL_READFUNC_ABORT; } - return (bytesRead); + return (size_t) bytesRead; } }; // class irodsCurl @@ -161,8 +159,6 @@ extern "C" { // 1. Write a standard issue microservice int irods_http_send_file( msParam_t* url, msParam_t* src_obj, ruleExecInfo_t* rei ) { dataObjInp_t dataObjInp, *myDataObjInp; - //TODO: At Paul: during compilation "warning: unused variable 'myUrl'" - char *myUrl; // Sanity checks if ( !rei || !rei->rsComm ) { diff --git a/msi_json_arrayops/libmsi_json_arrayops.cpp b/msi_json_arrayops/libmsi_json_arrayops.cpp index 6fac74b..635d785 100644 --- a/msi_json_arrayops/libmsi_json_arrayops.cpp +++ b/msi_json_arrayops/libmsi_json_arrayops.cpp @@ -22,7 +22,7 @@ extern "C" { const char *inJsonStr = parseMspForStr( json_str ); const char *inVal = parseMspForStr( val ); const char *inOps = parseMspForStr( ops ); - const int inIdx = parseMspForPosInt( sizeOrIndex ); + int inIdx = parseMspForPosInt( sizeOrIndex ); if( ! inJsonStr ) { cout << "msi_json_arrayops - invalid inJsonStr" << endl; @@ -69,9 +69,9 @@ extern "C" { } // find if jval is already presented in array - size_t i_match = outSizeOrIndex; + int i_match = outSizeOrIndex; for( int i=0; i < outSizeOrIndex; i++ ) { - json_t *ov = json_array_get(root, i); + json_t *ov = json_array_get(root, (size_t) i); if ( json_equal(ov, jval) ) { i_match = i; break; } } @@ -85,7 +85,7 @@ extern "C" { if ( i_match < outSizeOrIndex ) { if ( strOps == "rm" ) { - json_array_remove(root, i_match); + json_array_remove(root, (size_t) i_match); outSizeOrIndex = (int) json_array_size(root); } else { outSizeOrIndex = i_match; @@ -96,7 +96,7 @@ extern "C" { } else if ( strOps == "size" ) { outSizeOrIndex = (int) json_array_size(root); } else if ( strOps == "get" ) { - json_t *elem = json_array_get(root, inIdx); + json_t *elem = json_array_get(root, (size_t) inIdx); // Updated our rule with added functionality from Utrecht University /* output a string directly, but encode other json types using json_dumps with JSON_ENCODE_ANY set */ diff --git a/msi_json_objops/libmsi_json_objops.cpp b/msi_json_objops/libmsi_json_objops.cpp index 91a4031..8973fb5 100644 --- a/msi_json_objops/libmsi_json_objops.cpp +++ b/msi_json_objops/libmsi_json_objops.cpp @@ -104,7 +104,7 @@ extern "C" { if ( data ) { if ( json_is_array( data ) ) { size_t i_match = json_array_size(data); - for( int i=0; irsComm->rError, - ret.code(), + (int) ret.code(), ret.result().c_str()); }