[Gnome-print] [PATCH] warning cleanup



Hi.

Here's a patch that removes a number of warnings about implicit
declaration of functions. These were memcpy(), strcmp(), strlen(),
time(), and abs(). I'm building on i586-pc-linux-gnu, gcc-3.0,
on glibc-2.2.3.

I also put conditional `#ifdef' around an `#include "zlib.h"' line
because it seemed to need it - if not, why make the test in configure?

Please consider this for the next gnome-print release. Thanks
to everyone working on gnome-print, and GNOME!

Art Haas

2001-06-01  Art Haas  <ahaas@neosoft.com>

	*text-utils.c: include "config.h" and conditionally
	include <string.h>.

	*gt1-region.c: Same.

	*gt1-namecontext.c: Same.

	*gnome-font-family.c: Same.

	*gnome-print.c: Include <time.h>, not <sys/time.h>, for
	time() prototype.

	*gnome-print-master-preview.c: Conditionally include
	<string.h>

	*gnome-font-dialog.c: Same.

	*gnome-print-encode.c: Same, and conditionalize the
	inclusion of "zlib.h"

	*gnome-print-ps.c: Include <stdlib.h> for abs().

========================================
--- ./libgnomeprint/text-utils.c.orig	Sat Oct  7 15:10:14 2000
+++ ./libgnomeprint/text-utils.c	Fri Jun  1 20:45:21 2001
@@ -21,9 +21,15 @@
  *
  */
 
+#include "config.h"
+
 #include <glib.h>
 #include <text-utils.h>
 #include <stdio.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 
 /* Tokens Stuff */
 #define is_spacer(x) (((x == ' ')  || \
--- ./libgnomeprint/gt1-region.c.orig	Tue Sep 19 16:37:13 2000
+++ ./libgnomeprint/gt1-region.c	Fri Jun  1 20:44:21 2001
@@ -4,8 +4,14 @@
  */
 /* A simple region-based allocator */
 
+#include "config.h"
+
 #include "gt1-misc.h"
 #include "gt1-region.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 
 #define REGION_BLOCK_SIZE 4096
 
--- ./libgnomeprint/gnome-print.c.orig	Mon May 21 21:04:11 2001
+++ ./libgnomeprint/gnome-print.c	Fri Jun  1 20:42:53 2001
@@ -32,7 +32,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <sys/time.h>
+#include <time.h>
 #include <errno.h>
 #include <libart_lgpl/art_affine.h>
 #include <libart_lgpl/art_vpath.h>
--- ./libgnomeprint/gnome-print-master-preview.c.orig	Tue Nov 21 12:49:51 2000
+++ ./libgnomeprint/gnome-print-master-preview.c	Fri Jun  1 20:40:53 2001
@@ -60,6 +60,10 @@
 #include "gnome-print-master-preview.h"
 #include "gnome-print-preview-icons.h"
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 #define TOOLBAR_BUTTON_BASE 5
 #define MOVE_INDEX          5
 
--- ./libgnomeprint/gnome-print-ps.c.orig	Tue Nov 21 12:49:51 2000
+++ ./libgnomeprint/gnome-print-ps.c	Fri Jun  1 20:48:45 2001
@@ -8,6 +8,7 @@
  */
 
 #include "config.h"
+#include <stdlib.h>
 #include <string.h>
 #include <math.h>
 #include <ctype.h>
--- ./libgnomeprint/gnome-font-dialog.c.orig	Thu Jan 11 18:49:08 2001
+++ ./libgnomeprint/gnome-font-dialog.c	Fri Jun  1 20:37:56 2001
@@ -26,6 +26,10 @@
 #include <libgnomeprint/gnome-canvas-hacktext.h>
 #include <libgnomeprint/gnome-font-family.h>
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
 struct _GnomeFontSelection
 {
 	GtkHBox hbox;
--- ./libgnomeprint/gnome-print-encode.c.orig	Sun Dec 24 15:39:43 2000
+++ ./libgnomeprint/gnome-print-encode.c	Fri Jun  1 20:40:16 2001
@@ -26,7 +26,13 @@
 #include <glib.h>
 #include <libgnomeprint/gnome-print-encode.h>
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_ZLIB_H
 #include "zlib.h"
+#endif
 
 /* TODO : add a parameter to the encodeion methods called "size to beat" so that
    we stop encodeing a row that we know is too large to be chosen. We only need
--- ./libgnomeprint/gt1-namecontext.c.orig	Tue Sep 19 16:37:13 2000
+++ ./libgnomeprint/gt1-namecontext.c	Fri Jun  1 20:43:48 2001
@@ -4,9 +4,15 @@
  */
 /* A module for a simple "name context", i.e. lisp-style atoms */
 
+#include "config.h"
+
 #include "gt1-misc.h"
 
 #include "gt1-namecontext.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 
 /* btw, I do not know who wrote the following comment. I modified this
    file somewhat from gimp's app/procedural_db.c hash function. */
--- ./libgnomeprint/gnome-font-family.c.orig	Sun Nov 19 20:38:56 2000
+++ ./libgnomeprint/gnome-font-family.c	Fri Jun  1 20:55:17 2001
@@ -1,7 +1,13 @@
 #define _GNOME_FONT_FAMILY_C_
 
+#include "config.h"
+
 #include <libgnomeprint/gp-fontmap.h>
 #include <libgnomeprint/gnome-font-family.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 
 struct _GnomeFontFamily {
 	GtkObject object;




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