Fix compilation warnings
authorBenjamin Poirier <benjamin.poirier@polymtl.ca>
Fri, 18 Dec 2009 15:41:26 +0000 (10:41 -0500)
committerBenjamin Poirier <benjamin.poirier@polymtl.ca>
Fri, 18 Dec 2009 19:04:17 +0000 (14:04 -0500)
Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
lttv/lttv/sync/event_analysis_chull.c
lttv/lttv/sync/event_matching_broadcast.c
lttv/lttv/sync/event_matching_tcp.c
lttv/lttv/sync/event_processing_lttng_standard.c
lttv/modules/text/sync_chain_batch.c

index 0e583791cedd7d8a3a67ec4c5099afd48213adcf..8e965b72a7e1296de507cfe187f893f4784d5ae3 100644 (file)
@@ -22,6 +22,7 @@
 #endif
 
 #include <errno.h>
+#include <inttypes.h>
 #include <math.h>
 #include <float.h>
 #include <stdlib.h>
@@ -270,7 +271,7 @@ static void gfDumpHullToFile(gpointer data, gpointer userData)
        Point* point;
 
        point= (Point*) data;
-       fprintf((FILE*) userData, "%20llu %20llu\n", point->x, point->y);
+       fprintf((FILE*) userData, "%20" PRIu64 " %20" PRIu64 "\n", point->x, point->y);
 }
 
 
@@ -401,7 +402,8 @@ static void analyzeMessageCHull(SyncState* const syncState, Message* const messa
                newPoint->x= message->inE->cpuTime;
                newPoint->y= message->outE->cpuTime;
                hullType= UPPER;
-               g_debug("Reception point hullArray[%lu][%lu] x= inE->time= %llu y= outE->time= %llu",
+               g_debug("Reception point hullArray[%lu][%lu] "
+                       "x= inE->time= %" PRIu64 " y= outE->time= %" PRIu64,
                        message->inE->traceNum, message->outE->traceNum, newPoint->x,
                        newPoint->y);
        }
@@ -411,7 +413,8 @@ static void analyzeMessageCHull(SyncState* const syncState, Message* const messa
                newPoint->x= message->outE->cpuTime;
                newPoint->y= message->inE->cpuTime;
                hullType= LOWER;
-               g_debug("Send point hullArray[%lu][%lu] x= inE->time= %llu y= outE->time= %llu",
+               g_debug("Send point hullArray[%lu][%lu] "
+                       "x= inE->time= %" PRIu64 " y= outE->time= %" PRIu64,
                        message->inE->traceNum, message->outE->traceNum, newPoint->x,
                        newPoint->y);
        }
@@ -703,7 +706,9 @@ static int jointCmp(const Point const* p1, const Point const* p2, const
        const double fuzzFactor= 0.;
 
        result= crossProductK(p1, p2, p1, p3);
-       g_debug("crossProductK(p1= (%llu, %llu), p2= (%llu, %llu), p1= (%llu, %llu), p3= (%llu, %llu))= %g",
+       g_debug("crossProductK(p1= (%" PRIu64 ", %" PRIu64 "), "
+               "p2= (%" PRIu64 ", %" PRIu64 "), p1= (%" PRIu64 ", %" PRIu64 "), "
+               "p3= (%" PRIu64 ", %" PRIu64 "))= %g",
                p1->x, p1->y, p2->x, p2->y, p1->x, p1->y, p3->x, p3->y, result);
        if (result < fuzzFactor)
        {
@@ -1075,14 +1080,15 @@ static Factors* calculateFactorsExact(GQueue* const cu, GQueue* const cl, const
        p1= g_queue_peek_nth(c1, i1);
        p2= g_queue_peek_nth(c2, i2);
 
-       g_debug("Resulting points are: c1[i1]: x= %llu y= %llu c2[i2]: x= %llu y= %llu",
-               p1->x, p1->y, p2->x, p2->y);
+       g_debug("Resulting points are: c1[i1]: x= %" PRIu64 " y= %" PRIu64
+               " c2[i2]: x= %" PRIu64 " y= %" PRIu64 "", p1->x, p1->y, p2->x, p2->y);
 
        result= malloc(sizeof(Factors));
        result->drift= slope(p1, p2);
        result->offset= intercept(p1, p2);
 
-       g_debug("Resulting factors are: drift= %g offset= %g", result->drift, result->offset);
+       g_debug("Resulting factors are: drift= %g offset= %g", result->drift,
+               result->offset);
 
        return result;
 }
index 1f3ec560b15a5caf322bd4be231e3c20d6f6926e..968856979b157496dcd6c00ac5c2d64e7740c758 100644 (file)
@@ -21,6 +21,7 @@
 #endif
 
 #include <errno.h>
+#include <inttypes.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -425,7 +426,7 @@ static void writeAccuracyPoints(MatchingGraphsBroadcast* graphs, const
                        if (eventI->traceNum < eventJ->traceNum)
                        {
                                fprintf(graphs->accuracyPoints[eventJ->traceNum][eventI->traceNum],
-                                       "%20llu %20.9f\n", eventI->cpuTime,
+                                       "%20" PRIu64 " %20.9f\n", eventI->cpuTime,
                                        wallTimeSub(&eventJ->wallTime, &eventI->wallTime));
                                graphs->pointsNb[eventJ->traceNum][eventI->traceNum]++;
                        }
index 8d4d8e322c484d4b453b2c47ec1bdd266b12b49d..9ba8b63265463670db782c8dddb57b72f76890c3 100644 (file)
@@ -21,6 +21,7 @@
 #endif
 
 #include <errno.h>
+#include <inttypes.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -645,7 +646,7 @@ static void writeMessagePoint(FILE* stream, const Message* const message)
                y= message->inE->cpuTime;
        }
 
-       fprintf(stream, "%20llu %20llu\n", x, y);
+       fprintf(stream, "%20" PRIu64 " %20" PRIu64 "\n", x, y);
 }
 
 
index 76a754b82e2a9650109d86944a2220b67dde2cdf..c3b4da23d4c3ca97942c98f9783ecd4b0a8d302d 100644 (file)
@@ -113,7 +113,8 @@ static void initProcessingLTTVStandard(SyncState* const syncState, ...)
        for(i= 0; i < syncState->traceNb; i++)
        {
                g_hash_table_insert(processingData->traceNumTable,
-                       processingData->traceSetContext->traces[i]->t, (gpointer) i);
+                       processingData->traceSetContext->traces[i]->t,
+                       GUINT_TO_POINTER(i));
        }
 
        processingData->pendingRecv= malloc(sizeof(GHashTable*) *
@@ -384,6 +385,7 @@ static gboolean processEventLTTVStandard(void* hookData, void* callData)
        struct marker_info* info;
        SyncState* syncState;
        ProcessingDataLTTVStandard* processingData;
+       gpointer traceNumP;
 
        traceHook= (LttvTraceHook*) hookData;
        tfc= (LttvTracefileContext*) callData;
@@ -398,7 +400,8 @@ static gboolean processEventLTTVStandard(void* hookData, void* callData)
        wTime.nanosec= time.tv_nsec;
 
        g_assert(g_hash_table_lookup_extended(processingData->traceNumTable,
-                       trace, NULL, (gpointer*) &traceNum));
+                       trace, NULL, &traceNumP));
+       traceNum= GPOINTER_TO_INT(traceNumP);
 
        g_debug("Process event: time: %ld.%09ld trace: %ld (%p) name: %s ",
                time.tv_sec, time.tv_nsec, traceNum, trace,
index 55abb676c946678a29fcd552c6d1a1f5f6fe6f2d..23d3e05f9c833aea7b7cca60d8fa0728c5b84a93 100644 (file)
@@ -284,7 +284,6 @@ void setupSyncChain(LttvTracesetContext* const traceSetContext)
        struct TracesetChainState* tracesetChainState;
        SyncState* syncState;
        GList* result;
-       int retval;
 
        tracesetChainState= g_hash_table_lookup(tracesetChainStates, traceSetContext);
        syncState= malloc(sizeof(SyncState));
@@ -339,7 +338,7 @@ void teardownSyncChain(LttvTracesetContext* const traceSetContext)
        SyncState* syncState;
        struct timeval endTime;
        struct rusage endUsage;
-       unsigned int i, j;
+       unsigned int i;
        int retval;
 
        tracesetChainState= g_hash_table_lookup(tracesetChainStates, traceSetContext);
This page took 0.031681 seconds and 4 git commands to generate.