Fix warnings int the lttv/sync directory
authorYannick Brosseau <yannick.brosseau@gmail.com>
Tue, 25 Jan 2011 15:27:41 +0000 (10:27 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 25 Jan 2011 15:27:41 +0000 (10:27 -0500)
Mostly wrong usages of g_error

Edit: Add comment around init to NULL for gcc.

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttv/lttv/sync/event_analysis_chull.c
lttv/lttv/sync/event_analysis_eval.c
lttv/lttv/sync/event_matching_broadcast.c
lttv/lttv/sync/event_matching_tcp.c
lttv/lttv/sync/graph_functions.c
lttv/lttv/sync/sync_chain_lttv.c

index 21f288939c2fe1f9408cfb4d466dc22562e187fd..d36022c94ec9e29484ff4c0a9b4b7ce27f1b96f7 100644 (file)
@@ -240,7 +240,7 @@ static void openGraphFiles(SyncState* const syncState)
                                if ((analysisData->graphsData->hullPoints[i][j]= fopen(name, "w")) ==
                                        NULL)
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
                        }
                }
@@ -249,7 +249,7 @@ static void openGraphFiles(SyncState* const syncState)
        retval= chdir(cwd);
        if (retval == -1)
        {
-               g_error(strerror(errno));
+               g_error("%s", strerror(errno));
        }
        free(cwd);
 }
@@ -329,7 +329,7 @@ static void closeGraphFiles(SyncState* const syncState)
                                retval= fclose(analysisData->graphsData->hullPoints[i][j]);
                                if (retval != 0)
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
                        }
                }
index 8632b6a60ab0536b8108fa5019949ef2c776a1c4..8dbf5bb60ec3439fa26b53e37c7502a609a1f23a 100644 (file)
@@ -161,7 +161,7 @@ static void initAnalysisEval(SyncState* const syncState)
                rttStream= fopen(optionEvalRttFile.arg, "r");
                if (rttStream == NULL)
                {
-                       g_error(strerror(errno));
+                       g_error("%s", strerror(errno));
                }
 
                readRttInfo(analysisData->rttInfo, rttStream);
@@ -169,7 +169,7 @@ static void initAnalysisEval(SyncState* const syncState)
                retval= fclose(rttStream);
                if (retval == EOF)
                {
-                       g_error(strerror(errno));
+                       g_error("%s", strerror(errno));
                }
        }
 
@@ -274,14 +274,14 @@ static AnalysisHistogramEval* constructAnalysisHistogramEval(const char* const
                if ((*(FILE**)((void*) histogram + loopValues[i].pointsOffset)=
                                fopen(name, "w")) == NULL)
                {
-                       g_error(strerror(errno));
+                       g_error("%s", strerror(errno));
                }
        }
 
        retval= chdir(cwd);
        if (retval == -1)
        {
-               g_error(strerror(errno));
+               g_error("%s", strerror(errno));
        }
        free(cwd);
 
@@ -314,7 +314,7 @@ static void destroyAnalysisHistogramEval(AnalysisHistogramEval* const
                retval= fclose(*(FILE**)((void*) histogram + loopValues[i].pointsOffset));
                if (retval != 0)
                {
-                       g_error(strerror(errno));
+                       g_error("%s", strerror(errno));
                }
        }
 
@@ -463,11 +463,11 @@ static void writeHistogram(FILE* graphsStream, const struct RttKey* rttKey,
                // Remove the ",\\\n" from the last graph plot line
                if (ftruncate(fileno(graphsStream), ftell(graphsStream) - 3) == -1)
                {
-                       g_error(strerror(errno));
+                       g_error("%s", strerror(errno));
                }
                if (fseek(graphsStream, 0, SEEK_END) == -1)
                {
-                       g_error(strerror(errno));
+                       g_error("%s", strerror(errno));
                }
                fprintf(graphsStream, "\n");
        }
@@ -550,7 +550,7 @@ static void analyzeMessageEval(SyncState* const syncState, Message* const
        message)
 {
        AnalysisDataEval* analysisData= syncState->analysisData;
-       MessageStats* messageStats;
+       MessageStats* messageStats = NULL;      /* for gcc */
        double* rtt;
        double tt;
        struct RttKey rttKey;
@@ -1111,7 +1111,7 @@ static void readRttInfo(GHashTable* rttInfo, FILE* rttStream)
 
                if (retval == -1 && !feof(rttStream))
                {
-                       g_error(strerror(errno));
+                       g_error("%s", strerror(errno));
                }
 
                if (line[retval - 1] == '\n')
@@ -1124,7 +1124,7 @@ static void readRttInfo(GHashTable* rttInfo, FILE* rttStream)
                        &tmp);
                if (retval == EOF)
                {
-                       g_error(strerror(errno));
+                       g_error("%s", strerror(errno));
                }
                else if (retval != 3)
                {
@@ -1187,7 +1187,7 @@ static void positionStream(FILE* stream)
                                }
                                else
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
                        }
                }
index 9c83d9c677bdca47847392e044f3a010b106e9ca..4c66d18157d1ffa28c7c4afa7ce8d877c9b1d606 100644 (file)
@@ -382,7 +382,7 @@ static void openGraphDataFiles(SyncState* const syncState)
                        g_assert_cmpint(retval, <=, sizeof(name) - 1);
                        if ((graphs->accuracyPoints[i][j]= fopen(name, "w")) == NULL)
                        {
-                               g_error(strerror(errno));
+                               g_error("%s", strerror(errno));
                        }
                }
        }
@@ -390,7 +390,7 @@ static void openGraphDataFiles(SyncState* const syncState)
        retval= chdir(cwd);
        if (retval == -1)
        {
-               g_error(strerror(errno));
+               g_error("%s", strerror(errno));
        }
        free(cwd);
 }
@@ -460,7 +460,7 @@ static void closeGraphDataFiles(SyncState* const syncState)
                        retval= fclose(graphs->accuracyPoints[i][j]);
                        if (retval != 0)
                        {
-                               g_error(strerror(errno));
+                               g_error("%s", strerror(errno));
                        }
                }
                free(graphs->accuracyPoints[i]);
index 90d6c43cb3c6901bdaf9e69a1c9434496393e0a3..2d4fe51827cd88279562560e1a84267eb25dbbfd 100644 (file)
@@ -604,7 +604,7 @@ static void openGraphDataFiles(SyncState* const syncState)
                                if ((matchingData->messagePoints[i][j]= fopen(name, "w")) ==
                                        NULL)
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
                        }
                }
@@ -613,7 +613,7 @@ static void openGraphDataFiles(SyncState* const syncState)
        retval= chdir(cwd);
        if (retval == -1)
        {
-               g_error(strerror(errno));
+               g_error("%s", strerror(errno));
        }
        free(cwd);
 }
@@ -676,7 +676,7 @@ static void closeGraphDataFiles(SyncState* const syncState)
                                retval= fclose(matchingData->messagePoints[i][j]);
                                if (retval != 0)
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
                        }
                }
index c347b249b90fcb605bb1ea115bd89e688dfe96b3..91feef0c45c5a64f2cc28dc3424d3cf748ec4297 100644 (file)
@@ -55,11 +55,11 @@ FILE* createGraphsDir(const char* const graphsDir)
                                S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH
                                | S_IWOTH | S_IXOTH)) == -1)
        {
-               g_error(strerror(errno));
+               g_error("%s", strerror(errno));
        }
        if ((result= fdopen(graphsFp, "w")) == NULL)
        {
-               g_error(strerror(errno));
+               g_error("%s", strerror(errno));
        }
 
        fprintf(result,
@@ -69,7 +69,7 @@ FILE* createGraphsDir(const char* const graphsDir)
        retval= chdir(cwd);
        if (retval == -1)
        {
-               g_error(strerror(errno));
+               g_error("%s", strerror(errno));
        }
        free(cwd);
 
@@ -95,7 +95,7 @@ char* changeToGraphsDir(const char* const graphsDir)
        cwd= getcwd(NULL, 0);
        if (cwd == NULL)
        {
-               g_error(strerror(errno));
+               g_error("%s", strerror(errno));
        }
        while ((retval= chdir(graphsDir)) != 0)
        {
@@ -105,12 +105,12 @@ char* changeToGraphsDir(const char* const graphsDir)
                                S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH);
                        if (retval != 0)
                        {
-                               g_error(strerror(errno));
+                               g_error("%s", strerror(errno));
                        }
                }
                else
                {
-                       g_error(strerror(errno));
+                       g_error("%s", strerror(errno));
                }
        }
 
@@ -233,11 +233,11 @@ void writeGraphsScript(SyncState* const syncState)
 
                                if (ftruncate(fileno(syncState->graphsStream), trunc) == -1)
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
                                if (fseek(syncState->graphsStream, 0, SEEK_END) == -1)
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
 
                                fprintf(syncState->graphsStream,
index 95bef4418e4e8f1746e0f7dcb8c983a3217622ec..bb49bbd20b86c4a3484b660181d2731a382aa13e 100644 (file)
@@ -388,7 +388,7 @@ bool syncTraceset(LttvTracesetContext* const traceSetContext)
 
                if (fclose(syncState->graphsStream) != 0)
                {
-                       g_error(strerror(errno));
+                       g_error("%s", strerror(errno));
                }
        }
 
This page took 0.031281 seconds and 4 git commands to generate.