Commit b2f0fb5d authored by Greg Williams's avatar Greg Williams
Browse files

Bumped up warning level and fixes some resulting warnings to clean up the build

parent fd9845da
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@
  :support:
    - test/support/**
  :source:
    - src/lib/*.c
    - src/lib/**
    - src/utility/**
    - vendor/protobuf-c/protobuf-c/protobuf-c.c
    - vendor/socket99/socket99.c
  :include:
@@ -99,7 +100,11 @@
      - -D"$": DEFINES_TEST_PREPROCESS
      - -DGNU_COMPILER
      - -std=c99
      - -g
      - -Wall
      - -Wextra
      - -pedantic
      - -D_POSIX_C_SOURCE=1
      - ${1}
  :test_compiler:
    :executable: gcc
@@ -109,8 +114,11 @@
      - -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
      - -DGNU_COMPILER
      - -std=c99
      - -Wall
      - -g
      - -Wall
      - -Wextra
      - -pedantic
      - -D_POSIX_C_SOURCE=1
      - -c ${1}
      - -o ${2}
  :test_linker:
@@ -136,7 +144,11 @@
      - -D"$": 'COLLECTION_DEFINES_RELEASE_AND_VENDOR'
      - -DGNU_COMPILER
      - -std=c99
      - -g
      - -Wall
      - -Wextra
      - -pedantic
      - -D_POSIX_C_SOURCE=1
      - "-c \"${1}\""
      - "-o \"${2}\""
  :release_linker:
+2 −0
Original line number Diff line number Diff line
@@ -117,10 +117,12 @@ KineticOperation KineticClient_CreateOperation(
    }

    KineticPDU_Init(request, connection);
    KINETIC_PDU_INIT_WITH_MESSAGE(request, connection);
    KineticPDU_Init(response, connection);

    op.connection = connection;
    op.request = request;
    op.request->proto = &op.request->protoData.message.proto;
    op.response = response;

    return op;
+3 −4
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ void KineticLogger_Log(const char* message)
    }

    FileDesc = LogToConsole ? stderr : fopen(LogFile, "a");
    if (FileDesc >= 0)
    if (FileDesc != NULL)
    {
        fprintf(FileDesc, "%s\n", message);
        fflush(FileDesc);
@@ -372,7 +372,6 @@ void KineticLogger_LogStatus(KineticProto_Status* status)
        // Output detailed message, if supplied
        if (status->has_detailedMessage)
        {
            int i;
            char tmp[8], msg[256];
            const ProtobufCFieldDescriptor* statusDetailedMsgFieldDescriptor =
                protobuf_c_message_descriptor_get_field_by_name(
@@ -382,7 +381,7 @@ void KineticLogger_LogStatus(KineticProto_Status* status)
                statusDetailedMsgFieldDescriptor->descriptor;

            sprintf(msg, "  %s: ", statusDetailedMsgDescriptor->name);
            for (i = 0; i < status->detailedMessage.len; i++)
            for (size_t i = 0; i < status->detailedMessage.len; i++)
            {
                sprintf(tmp, "%02hhX", status->detailedMessage.data[i]);
                strcat(msg, tmp);
@@ -400,7 +399,7 @@ void KineticLogger_LogByteArray(const char* title, ByteArray bytes)
    const int lineLen = 4 + (bytesPerLine * byteChars);
    char hex[lineLen+1];
    char ascii[lineLen+1];
    for (int i = 0; i < bytes.len;)
    for (size_t i = 0; i < bytes.len;)
    {
        hex[0] = '\0';
        ascii[0] = '\0';
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ void KineticLogger_LogStatus(KineticProto_Status* status);
void KineticLogger_LogByteArray(const char* title, ByteArray bytes);

#define LOG(message) KineticLogger_Log(message)
#define LOGF(message, ...) KineticLogger_LogPrintf(message, ##__VA_ARGS__)
#define LOGF(message, ...) KineticLogger_LogPrintf(message, __VA_ARGS__)
#define LOG_LOCATION KineticLogger_LogPrintf("@ %s:%s:%d", __func__, __FILE__, __LINE__)

#endif // _KINETIC_LOGGER_H
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
static uint64_t KineticNBO_SwapByteOrder(uint8_t* pByte, size_t len)
{
    uint64_t swapped = 0u;
    for (int i = 0; i < len; i++)
    for (size_t i = 0; i < len; i++)
    {
        swapped = (swapped << 8) | pByte[i];
    }
Loading