]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Fixed invalid type conversions.
authorSebastian Harl <sh@tokkee.org>
Sat, 26 Apr 2014 10:28:17 +0000 (12:28 +0200)
committerSebastian Harl <sh@tokkee.org>
Sat, 26 Apr 2014 10:28:17 +0000 (12:28 +0200)
bindings/ruby/main.c
bindings/tcl/tclrrd.c

index c35dfa816ebe1171c0f31ba49df0804d36eba58e..6fa2810d7f607c33d5319c5c614e9a151a29530f 100644 (file)
@@ -51,7 +51,7 @@ string_arr string_arr_new(
             a.strings[i + 1] = strdup(StringValuePtr(v));
             break;
         case T_FIXNUM:
-            snprintf(buf, 63, "%ld", FIX2INT(v));
+            snprintf(buf, 63, "%d", FIX2INT(v));
             a.strings[i + 1] = strdup(buf);
             break;
         default:
index 869d6c781147f528fd81a98adf03db607434c330..c9fb89523eb2de3d12d98311155af3b9fbb11d60 100644 (file)
@@ -463,7 +463,7 @@ static int Rrd_Graph(
 {
     Tcl_Channel channel;
     int       mode, fd2;
-    ClientData fd1;
+    int       fd1;
     FILE     *stream = NULL;
     char    **calcpr = NULL;
     int       rc, xsize, ysize;
@@ -494,7 +494,7 @@ static int Rrd_Graph(
                              strerror(Tcl_GetErrno()), (char *) NULL);
             return TCL_ERROR;
         }
-        if (Tcl_GetChannelHandle(channel, TCL_WRITABLE, &fd1) != TCL_OK) {
+        if (Tcl_GetChannelHandle(channel, TCL_WRITABLE, (ClientData)&fd1) != TCL_OK) {
             Tcl_AppendResult(interp,
                              "cannot get file descriptor associated with \"",
                              argv[1], "\"", (char *) NULL);
@@ -504,7 +504,7 @@ static int Rrd_Graph(
          * Must dup() file descriptor so we can fclose(stream), otherwise the fclose()
          * would close Tcl's file descriptor
          */
-        if ((fd2 = dup((int)fd1)) == -1) {
+        if ((fd2 = dup(fd1)) == -1) {
             Tcl_AppendResult(interp,
                              "dup() failed for file descriptor associated with \"",
                              argv[1], "\": ", strerror(errno), (char *) NULL);