changeset 2679:c0a572a11ab9 default tip develop

Silence some warnings
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Mon, 14 May 2012 17:37:56 -0400
parents 6f5ec2164216
children
files libsrc/ParseArgv.c libsrc/hdf_convenience.c
diffstat 2 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libsrc/ParseArgv.c
+++ b/libsrc/ParseArgv.c
@@ -24,9 +24,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <inttypes.h>
 #include <math.h>
 #include <ParseArgv.h>
 
+
 /*
  * Default table of argument descriptors.  These are normally available
  * in every application.
@@ -174,10 +176,10 @@
       infoPtr = matchPtr;
       switch (infoPtr->type) {
       case ARGV_CONSTANT:
-         *((int *) infoPtr->dst) = (int) infoPtr->src;
+         *((int *) infoPtr->dst) = (intptr_t) infoPtr->src;
          break;
       case ARGV_INT:
-         nargs = (int) infoPtr->src;
+         nargs = (intptr_t) infoPtr->src;
          if (nargs<1) nargs=1;
          for (i=0; i<nargs; i++) {
             if (argc == 0) {
@@ -199,7 +201,7 @@
          }
          break;
       case ARGV_LONG:
-         nargs = (int) infoPtr->src;
+         nargs = (intptr_t) infoPtr->src;
          if (nargs<1) nargs=1;
          for (i=0; i<nargs; i++) {
             if (argc == 0) {
@@ -222,7 +224,7 @@
          break;
 
       case ARGV_STRING:
-         nargs = (int) infoPtr->src;
+         nargs = (intptr_t) infoPtr->src;
          if (nargs<1) nargs=1;
          for (i=0; i<nargs; i++) {
             if (argc == 0) {
@@ -238,7 +240,7 @@
          *((int *) infoPtr->dst) = dstIndex;
          goto argsDone;
       case ARGV_FLOAT:
-         nargs = (int) infoPtr->src;
+         nargs = (intptr_t) infoPtr->src;
          if (nargs<1) nargs=1;
          for (i=0; i<nargs; i++) {
             if (argc == 0) {
@@ -399,7 +401,7 @@
          switch (infoPtr->type) {
          case ARGV_INT: {
             FPRINTF(stderr, "\n\t\tDefault value:");
-            nargs = (int) infoPtr->src;
+            nargs = (intptr_t) infoPtr->src;
             if (nargs<1) nargs=1;
             for (j=0; j<nargs; j++) {
                FPRINTF(stderr, " %d", *(((int *) infoPtr->dst)+j));
@@ -408,7 +410,7 @@
          }
          case ARGV_FLOAT: {
             FPRINTF(stderr, "\n\t\tDefault value:");
-            nargs = (int) infoPtr->src;
+            nargs = (intptr_t) infoPtr->src;
             if (nargs<1) nargs=1;
             for (j=0; j<nargs; j++) {
                FPRINTF(stderr, " %g", *(((double *) infoPtr->dst)+j));
@@ -418,7 +420,7 @@
          case ARGV_STRING: {
             char *string;
 
-            nargs = (int) infoPtr->src;
+            nargs = (intptr_t) infoPtr->src;
             if (nargs<1) nargs=1;
             string = *((char **) infoPtr->dst);
             if ((nargs==1) && (string == NULL)) break;
--- a/libsrc/hdf_convenience.c
+++ b/libsrc/hdf_convenience.c
@@ -2173,6 +2173,8 @@
 		H5Dclose(new_id);
 	    }
 	    break;
+        default:
+            break;
 	}
     }
     return (MI_NOERROR);