Cast away warnings implicit 64-bit-to-32-bit conversions. (We should
authorGuy Harris <guy@alum.mit.edu>
Mon, 24 Dec 2012 23:10:18 +0000 (23:10 -0000)
committerGuy Harris <guy@alum.mit.edu>
Mon, 24 Dec 2012 23:10:18 +0000 (23:10 -0000)
probably have routines that convert strings to numbers and do range
checks, and should also ignore values in the recent and preferences
files that are out of range.)

Cast a string to "char *" to squelch an otherwise-unavoidable warning
about qualifiers being ignored.

The media type for raw binary data is application/octet-stream, not
application octet_stream.

svn path=/trunk/; revision=46727

ui/gtk/gui_utils.c
ui/gtk/gui_utils.h

index c6227c726f5c2d94ded803026570f8fde577b607..b03126757efdab2e96d267afd6451e6b0dac57e4 100644 (file)
@@ -514,16 +514,16 @@ window_geom_recent_read_pair(const char *name,
     }
 
     if (strcmp(key, "x") == 0) {
-        geom.x = strtol(value, NULL, 10);
+        geom.x = (gint)strtol(value, NULL, 10);
         geom.set_pos = TRUE;
     } else if (strcmp(key, "y") == 0) {
-        geom.y = strtol(value, NULL, 10);
+        geom.y = (gint)strtol(value, NULL, 10);
         geom.set_pos = TRUE;
     } else if (strcmp(key, "width") == 0) {
-        geom.width = strtol(value, NULL, 10);
+        geom.width = (gint)strtol(value, NULL, 10);
         geom.set_size = TRUE;
     } else if (strcmp(key, "height") == 0) {
-        geom.height = strtol(value, NULL, 10);
+        geom.height = (gint)strtol(value, NULL, 10);
         geom.set_size = TRUE;
     } else if (strcmp(key, "maximized") == 0) {
         if (g_ascii_strcasecmp(value, "true") == 0) {
@@ -1228,10 +1228,11 @@ copy_binary_to_clipboard(const guint8 *data_p,
                          int           len)
 {
     static GtkTargetEntry target_entry[] = {
-         {"application/octet_stream", 0, 0}}; /* XXX - this not understood by most applications,
-                                             * but can be pasted into the better hex editors - is
-                                             * there something better that we can do?
-                                             */
+         {(char *)"application/octet-stream", 0, 0}};
+            /* XXX - this is not understood by most applications,
+              * but can be pasted into the better hex editors - is
+              * there something better that we can do?
+              */
 
     GtkClipboard  *cb;
     copy_binary_t *copy_data;
index f85262b1f539dddae8b90953a69d8a48fb49b993..a17b78a4eb82772ff7473d0c206ed24c16e6fa95 100644 (file)
@@ -293,7 +293,7 @@ extern GtkWidget *pixbuf_to_widget(const char * pb_data);
 extern void copy_to_clipboard(GString *str);
 
 /** Copy an array of bytes to the clipboard.
- * Copies as mime-type application/octet_stream in GTK 2.
+ * Copies as mime-type application/octet-stream in GTK 2.
  *
  * @param data_p Pointer to data to be copied.
  * @param len Number of bytes in the data to be copied.