[gcompris/gcomprixogoo] Avoid compilation issue in debug mode.



commit ebe67e9a926b3084df51ed0ecdf35fa91706a743
Author: Bruno Coudoin <bruno coudoin gcompris net>
Date:   Sat Oct 30 15:53:11 2010 +0200

    Avoid compilation issue in debug mode.

 src/chess_computer-activity/gnuchess/debug.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/chess_computer-activity/gnuchess/debug.c b/src/chess_computer-activity/gnuchess/debug.c
index 761018a..9701696 100644
--- a/src/chess_computer-activity/gnuchess/debug.c
+++ b/src/chess_computer-activity/gnuchess/debug.c
@@ -13,6 +13,7 @@
 #include <sys/time.h>
 #include <fcntl.h>
 #include <stdarg.h>
+#include <string.h>
 
 #define MAX_DEBUG 1000
 #define DEBUG_FILENAME "gnuchess.debug"
@@ -24,7 +25,7 @@ int dbg_open(const char *name)
 {
    int flags = O_WRONLY | O_CREAT | O_APPEND;
    int mode = 0777;
-   
+
    if (name == NULL) {
       debug_fd = open(DEBUG_FILENAME, flags, mode);
    } else {
@@ -53,9 +54,9 @@ int dbg_printf(const char *fmt, ...)
    va_list ap;
    char buf[MAX_DEBUG];
    struct timeval tv;
-   
+
    gettimeofday(&tv, NULL);
-   sprintf(buf, "%010ld.%06ld: ", tv.tv_sec, tv.tv_usec);
+   sprintf(buf, "%010ld.%06ld: ", (long int)tv.tv_sec, (long int)tv.tv_usec);
    write(debug_fd, buf, strlen(buf));
 
    va_start(ap, fmt);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]