Fix compilation (type correctness, makefile) 52/267452/2
authorMichal Bloch <m.bloch@samsung.com>
Fri, 3 Dec 2021 17:57:41 +0000 (18:57 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Wed, 8 Dec 2021 12:54:48 +0000 (13:54 +0100)
Change-Id: I23ae1f9e58dca2de0a8715e5ca8f63264070879c

Makefile
benchmark/gdbus.c
benchmark/pipe.c
benchmark/sharedmem.c
benchmark/socket.c

index 62def2e52faa8b6b68bff0e2964cc11e4017cf4b..11d38e93546d753bf5adfe776b953f30a3e0f3e7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,8 @@
 CFLAGS= -D_GNU_SOURCE
-CFLAGS+= -I/usr/include/dlog -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0
-CFLAGS+= -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -L/usr/lib
+CFLAGS+=`pkg-config --cflags glib-2.0 dbus-1 gio-2.0`
 CFLAGS+=-Wall -O2 -g
-LDFLAGS= -lglib-2.0 -lgobject-2.0 -lgio-2.0 -lgmodule-2.0 -ldbus-1 -lgthread-2.0 -lpthread -lrt -lpcre
-LDFLAGS+=-lm
+LDFLAGS=`pkg-config --libs   glib-2.0 dbus-1 gio-2.0`
+LDFLAGS+=-lpthread -lrt -lm
 DFTSRC=benchmark/common.c
 
 all:
index 8f05062c8800f73e83db3d3576c6f83388896136..f1abff90e9c175d86feb1ddabb294ca91656406e 100644 (file)
@@ -34,7 +34,7 @@ static GVariant *handle_get_property (GDBusConnection *connection,
                const gchar           *property_name,
                GError                **error,
                gpointer              user_data)
-{ }
+{ return NULL; }
 
 static gboolean handle_set_property (GDBusConnection *connection,
                const gchar           *sender,
@@ -44,7 +44,7 @@ static gboolean handle_set_property (GDBusConnection *connection,
                GVariant              *value,
                GError                **error,
                gpointer              user_data)
-{ }
+{ return TRUE; }
 
 static void handle_method_call (GDBusConnection       *connection,
                const gchar           *sender,
index 9993a28ec9622077d749ca858b4bcd2196462a56..5d31e6e065ab791081bbe9c0bd23f69e5d87580f 100644 (file)
@@ -150,7 +150,7 @@ void Measure_bandwidth(void)
                return;
        }
        close(ready_fd);
-       ready_ptr[0] = "n";
+       *ready_ptr = 'n';
 
        for(int i = 0; i < nprocs/2; i++) {
                if(pipe(returnp[i]) == -1) {
@@ -187,7 +187,7 @@ void Measure_bandwidth(void)
                                        close(p[child/2][0]);
 
                                // Wait for parent
-                               while(ready_ptr[0] == "n") {
+                               while (*ready_ptr == 'n') {
                                }
 
                                if(child % 2 == 0) {
@@ -222,7 +222,7 @@ void Measure_bandwidth(void)
 
        usleep(100000);
        close(p[0][1]);
-       ready_ptr[0] = "y";
+       *ready_ptr = 'y';
 
        Receive(0, p[0][0], msize, false);
        close(p[0][0]);
index a1056e6b67d8d28e5784a9b7bec47c8fd55d57d9..66a6644629bb6505d8afb48b995b09975d5f4808 100644 (file)
@@ -22,7 +22,7 @@ bool lt_on, bw_on;
 void Receive(void *r1, register char *r2, register int size, bool is_lt)
 {
        static int bw_cnt = 0;
-       unsigned long long start;
+       unsigned long long start = 0;
        unsigned long long end;
        struct timespec clock;
        register char read_cnt = 0;
@@ -163,7 +163,7 @@ void Measure_bandwidth(void)
                return;
        }
        close(ready_fd);
-       ready_ptr[0] = "n";
+       *ready_ptr = 'n';
 
        for(int i = 0; i < nprocs/2; i++) {
                sprintf(name, "bwsharedmem%d", i);
@@ -208,7 +208,7 @@ void Measure_bandwidth(void)
                                }
 
                                // Wait for parent
-                               while(ready_ptr[0] == "n") {
+                               while (*ready_ptr == 'n') {
                                }
 
                                if(child % 2 == 0) {
@@ -240,7 +240,7 @@ void Measure_bandwidth(void)
        }
 
        sleep(1);
-       ready_ptr[0] = "y";
+       *ready_ptr = 'y';
 
        Receive(NULL, shm_ptr[0], msize, false);
        for(int child = 1; child < nprocs; child++) {
index 6945a640054c5244c2ea0bcce07db5564fb4490f..b9c7f3ccfbf80d3f553047b588fefa6d3e94e320 100644 (file)
@@ -150,7 +150,7 @@ void Measure_bandwidth(void)
                return;
        }
        close(ready_fd);
-       ready_ptr[0] = "n";
+       *ready_ptr = 'n';
 
        for(int i = 0; i < nprocs/2; i++) {
                if(pipe(returnp[i]) == -1) {
@@ -189,7 +189,7 @@ void Measure_bandwidth(void)
                                }
 
                                // Wait for parent
-                               while(ready_ptr[0] == "n") {
+                               while (*ready_ptr == 'n') {
                                }
 
                                if(child % 2 == 0) {
@@ -223,7 +223,7 @@ void Measure_bandwidth(void)
        }
 
        sleep(1);
-       ready_ptr[0] = "y";
+       *ready_ptr = 'y';
 
        Receive(0, fd[0][1], msize, false);
        close(fd[0][1]);