[dia] [warningectomy] pointer targets differ in signedness
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [warningectomy] pointer targets differ in signedness
- Date: Sat, 4 May 2013 18:58:55 +0000 (UTC)
commit d25d032004cb9056299b615f6de9261a77268f81
Author: Hans Breuer <hans breuer org>
Date: Fri May 3 16:16:26 2013 +0200
[warningectomy] pointer targets differ in signedness
also some formatiing and adding a missing copyright notice
app/commands.c | 2 +-
app/cursor.c | 6 +++---
app/navigation.c | 7 +++----
lib/dia_svg.c | 2 +-
lib/prop_pixbuf.c | 4 ++--
lib/prop_pixbuf.h | 2 +-
objects/custom_lines/custom_linetypes.c | 4 ++--
plug-ins/python/pydia-image.c | 6 +++---
plug-ins/svg/svg-import.c | 6 +++---
plug-ins/xfig/xfig-export.c | 24 ++++++++++++++++++++++--
10 files changed, 41 insertions(+), 22 deletions(-)
---
diff --git a/app/commands.c b/app/commands.c
index 32212b4..b4571f6 100644
--- a/app/commands.c
+++ b/app/commands.c
@@ -484,7 +484,7 @@ _clipboard_get_data_callback (GtkClipboard *clipboard,
if (fread (buf, 1, st.st_size, f) == st.st_size)
gtk_selection_data_set (selection_data,
gdk_atom_intern_static_string (target_entries[info-1].target), 8,
- buf, st.st_size);
+ (guint8 *)buf, st.st_size);
}
g_free (buf);
fclose (f);
diff --git a/app/cursor.c b/app/cursor.c
index b01e1bc..539cefb 100644
--- a/app/cursor.c
+++ b/app/cursor.c
@@ -31,7 +31,7 @@ static struct {
/* Can't use a union because it can't be statically initialized
(except for the first element) */
int gdk_cursor_number;
- const gchar *data;
+ const guint8 *data;
int hot_x;
int hot_y;
GdkCursor *cursor;
@@ -68,7 +68,7 @@ static struct {
static GdkCursor *create_cursor(GdkWindow *window,
- const gchar *data,
+ const guint8 *data,
int hot_x, int hot_y);
GdkCursor *
@@ -97,7 +97,7 @@ get_cursor(DiaCursorType ctype) {
GdkCursor *
create_cursor(GdkWindow *window,
- const gchar *data,
+ const guint8 *data,
int hot_x, int hot_y)
{
GdkPixbuf *pixbuf;
diff --git a/app/navigation.c b/app/navigation.c
index f268ebe..704bb8b 100644
--- a/app/navigation.c
+++ b/app/navigation.c
@@ -241,11 +241,10 @@ on_button_navigation_popup_pressed (GtkButton * button, gpointer _ddisp)
GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
/*cursor*/
- if(MIN(nav->frame_h, nav->frame_w) > STD_CURSOR_MIN){
+ if (MIN(nav->frame_h, nav->frame_w) > STD_CURSOR_MIN) {
nav->cursor = gdk_cursor_new (GDK_FLEUR);
- }
- else{/*the miniframe is very small, so we use a minimalist cursor*/
- unsigned char cursor_none_data[] = { 0x00 };
+ } else { /*the miniframe is very small, so we use a minimalist cursor*/
+ gchar cursor_none_data[] = { 0x00 };
GdkBitmap * bitmap;
GdkColor fg = { 0, 65535, 65535, 65535};
GdkColor bg = { 0, 0, 0, 0 };
diff --git a/lib/dia_svg.c b/lib/dia_svg.c
index a66361e..b34d0be 100644
--- a/lib/dia_svg.c
+++ b/lib/dia_svg.c
@@ -531,7 +531,7 @@ dia_svg_parse_style(xmlNodePtr node, DiaSvgStyle *s, real user_scale)
}
str = xmlGetProp(node, (const xmlChar *)"stroke-dasharray");
if (str) {
- _parse_dasharray (s, user_scale, str, NULL);
+ _parse_dasharray (s, user_scale, (gchar *)str, NULL);
xmlFree(str);
}
/* text-props, again ;( */
diff --git a/lib/prop_pixbuf.c b/lib/prop_pixbuf.c
index 32c8c8f..62f1e03 100644
--- a/lib/prop_pixbuf.c
+++ b/lib/prop_pixbuf.c
@@ -67,7 +67,7 @@ pixbufprop_copy(PixbufProperty *src)
* @param b64 Base64 encoded data
*/
GdkPixbuf *
-pixbuf_decode_base64 (const char *b64)
+pixbuf_decode_base64 (const gchar *b64)
{
/* see lib/prop_pixbuf.c(data_pixbuf) for a very similiar implementation */
GdkPixbuf *pixbuf = NULL;
@@ -208,7 +208,7 @@ pixbuf_encode_base64 (const GdkPixbuf *pixbuf)
&ed.state, &ed.save);
ed.array->data[ed.size] = '\0';
- return g_byte_array_free (ed.array, FALSE);
+ return (gchar *)g_byte_array_free (ed.array, FALSE);
}
void
data_add_pixbuf (AttributeNode attr, GdkPixbuf *pixbuf)
diff --git a/lib/prop_pixbuf.h b/lib/prop_pixbuf.h
index 1c08cf6..242c3cd 100644
--- a/lib/prop_pixbuf.h
+++ b/lib/prop_pixbuf.h
@@ -43,6 +43,6 @@ typedef struct {
void prop_pixbuftypes_register(void);
gchar *pixbuf_encode_base64 (const GdkPixbuf *);
-GdkPixbuf *pixbuf_decode_base64 (const char *b64);
+GdkPixbuf *pixbuf_decode_base64 (const gchar *b64);
#endif /* PROP_PIXBUF_H */
diff --git a/objects/custom_lines/custom_linetypes.c b/objects/custom_lines/custom_linetypes.c
index 422c40d..61f192f 100644
--- a/objects/custom_lines/custom_linetypes.c
+++ b/objects/custom_lines/custom_linetypes.c
@@ -108,8 +108,8 @@ _custom_zigzagline_load (ObjectNode obj_node, int version, DiaContext *ctx, DiaO
LineInfo *line_info;
xmlChar *typestr;
- typestr = (char *) xmlGetProp(obj_node, (const xmlChar *)"type");
- ot = object_get_type (typestr);
+ typestr = xmlGetProp(obj_node, (const xmlChar *)"type");
+ ot = object_get_type ((gchar *)typestr);
line_info = ot->default_user_data;
if (typestr)
diff --git a/plug-ins/python/pydia-image.c b/plug-ins/python/pydia-image.c
index c60346d..6692b13 100644
--- a/plug-ins/python/pydia-image.c
+++ b/plug-ins/python/pydia-image.c
@@ -107,18 +107,18 @@ PyDiaImage_GetAttr(PyDiaImage *self, gchar *attr)
if (!s)
return PyErr_NoMemory();
- py_s = PyString_FromStringAndSize(s, len);
+ py_s = PyString_FromStringAndSize((const char *)s, len);
g_free (s);
return py_s;
}
else if (!strcmp(attr, "mask_data")) {
- char* s = dia_image_mask_data(self->image);
+ unsigned char* s = dia_image_mask_data(self->image);
int len = dia_image_width(self->image) * dia_image_height(self->image);
PyObject* py_s;
if (!s)
return PyErr_NoMemory();
- py_s = PyString_FromStringAndSize(s, len);
+ py_s = PyString_FromStringAndSize((const char *)s, len);
g_free (s);
return py_s;
}
diff --git a/plug-ins/svg/svg-import.c b/plug-ins/svg/svg-import.c
index d1a9074..433f1a4 100644
--- a/plug-ins/svg/svg-import.c
+++ b/plug-ins/svg/svg-import.c
@@ -1059,7 +1059,7 @@ read_items (xmlNodePtr startnode,
g_free (group_gs);
g_free (matrix);
} else if (!xmlStrcmp(node->name, (const xmlChar *)"symbol")) {
- /* ignore �viewBox� and �preserveAspectRatio� */
+ /* ignore 'viewBox' and 'preserveAspectRatio' */
GList *moreitems = read_items (node->xmlChildrenNode, parent_gs, defs_ht, filename_svg, ctx);
/* only one object or create a group */
@@ -1203,7 +1203,7 @@ _parse_shape_cp (xmlNodePtr node, real *x, real *y, gboolean *mcp)
if (sx && sy) {
*x = g_ascii_strtod ((const char *)sx, NULL);
*y = g_ascii_strtod ((const char *)sy, NULL);
- *mcp = (sm ? strcmp (sm, "yes") == 0 : FALSE);
+ *mcp = (sm ? strcmp ((const char *)sm, "yes") == 0 : FALSE);
return TRUE;
}
if (sx) xmlFree (sx);
@@ -1272,7 +1272,7 @@ gboolean
import_memory_svg (const guchar *p, guint size, DiagramData *dia,
DiaContext *ctx, void *user_data)
{
- xmlDocPtr doc = xmlParseMemory (p, size);
+ xmlDocPtr doc = xmlParseMemory ((const char *)p, size);
if (!doc) {
xmlErrorPtr err = xmlGetLastError ();
diff --git a/plug-ins/xfig/xfig-export.c b/plug-ins/xfig/xfig-export.c
index 679488b..22d8826 100644
--- a/plug-ins/xfig/xfig-export.c
+++ b/plug-ins/xfig/xfig-export.c
@@ -1,3 +1,23 @@
+/* Dia -- an diagram creation/manipulation program
+ * Copyright (C) 1998 Alexander Larsson
+ *
+ * xfig-export.c: xfig export filter for dia
+ * Copyright (C) 2001 Lars Clausen
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -413,7 +433,7 @@ figText(XfigRenderer *renderer, const guchar *text)
int i, j;
int len = strlen((char *) text);
int newlen = len;
- guchar *returntext;
+ char *returntext;
for (i = 0; i < len; i++) {
if (text[i] > 127) {
newlen += 3;
@@ -435,7 +455,7 @@ figText(XfigRenderer *renderer, const guchar *text)
}
}
returntext[j] = 0;
- return returntext;
+ return (guchar *)returntext;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]