[lasem] dom_parser: we really want int as the type for the size parameter.



commit 0247f45a78ca309d05b5474774f49541df5b5c47
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Sun Nov 21 23:24:21 2010 +0100

    dom_parser: we really want int as the type for the size parameter.
    
    A negative value means size is not known.

 src/lasemrender.c  |    4 ++--
 src/lsmdomparser.c |    8 ++++----
 src/lsmdomparser.h |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/lasemrender.c b/src/lasemrender.c
index 3ea20a5..c3abcf8 100644
--- a/src/lasemrender.c
+++ b/src/lasemrender.c
@@ -170,12 +170,12 @@ int main(int argc, char **argv)
 	if (document != NULL) {
 		if (lsm_debug_check ("dom")) {
 			void *buffer;
-			size_t size;
+			int size;
 
 			lsm_dom_document_save_to_memory (document, &buffer, &size, NULL);
 
 			if (buffer != NULL) {
-				g_printf ("%*s\n", (int) size, (char *) buffer);
+				g_printf ("%*s\n", size, (char *) buffer);
 				g_free (buffer);
 			}
 		}
diff --git a/src/lsmdomparser.c b/src/lsmdomparser.c
index ed87546..1842379 100644
--- a/src/lsmdomparser.c
+++ b/src/lsmdomparser.c
@@ -216,7 +216,7 @@ lsm_dom_parser_declare_entity (void * user_data, const xmlChar * name, int type,
 	}
 }
 
-#if 0
+#if 1
 static void
 lsm_dom_parser_warning (void *user_data, const char *msg, ...)
 {
@@ -249,7 +249,7 @@ lsm_dom_parser_fatal_error (void *user_data, const char *msg, ...)
 #endif
 
 static xmlSAXHandler sax_handler = {
-#if 0
+#if 1
 	.warning = lsm_dom_parser_warning,
 	.error = lsm_dom_parser_error,
 	.fatalError = lsm_dom_parser_fatal_error,
@@ -282,7 +282,7 @@ typedef enum {
 } LsmDomDocumentError;
 
 LsmDomDocument *
-lsm_dom_document_new_from_memory (const void *buffer, size_t size, GError **error)
+lsm_dom_document_new_from_memory (const void *buffer, int size, GError **error)
 {
 	static LsmDomSaxParserState state;
 
@@ -376,7 +376,7 @@ lsm_dom_document_save_to_stream (LsmDomDocument *document, GOutputStream *stream
 }
 
 void
-lsm_dom_document_save_to_memory	(LsmDomDocument *document, void **buffer, size_t *size, GError **error)
+lsm_dom_document_save_to_memory	(LsmDomDocument *document, void **buffer, int *size, GError **error)
 {
 	GOutputStream *stream;
 
diff --git a/src/lsmdomparser.h b/src/lsmdomparser.h
index 2633e04..b1a61ef 100644
--- a/src/lsmdomparser.h
+++ b/src/lsmdomparser.h
@@ -29,7 +29,7 @@
 
 G_BEGIN_DECLS
 
-LsmDomDocument * 	lsm_dom_document_new_from_memory 	(const void *buffer, size_t size, GError **error);
+LsmDomDocument * 	lsm_dom_document_new_from_memory 	(const void *buffer, int size, GError **error);
 LsmDomDocument * 	lsm_dom_document_new_from_path 		(const char *path, GError **error);
 LsmDomDocument * 	lsm_dom_document_new_from_url 		(const char *url, GError **error);
 
@@ -38,7 +38,7 @@ void			lsm_dom_document_save_to_stream		(LsmDomDocument *document,
 								 GError **error);
 void			lsm_dom_document_save_to_memory		(LsmDomDocument *documennt,
 								 void **buffer,
-								 size_t *size,
+								 int *size,
 								 GError **error);
 void			lsm_dom_document_save_to_path		(LsmDomDocument *documennt,
 								 const char *path,



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