[postgis-tickets] r15244 - Reorganize code to make comments have more sense

Sandro Santilli strk at kbt.io
Tue Nov 22 23:34:29 PST 2016


Author: strk
Date: 2016-11-22 23:34:29 -0800 (Tue, 22 Nov 2016)
New Revision: 15244

Modified:
   trunk/liblwgeom/lwutil.c
Log:
Reorganize code to make comments have more sense

Modified: trunk/liblwgeom/lwutil.c
===================================================================
--- trunk/liblwgeom/lwutil.c	2016-11-22 06:58:02 UTC (rev 15243)
+++ trunk/liblwgeom/lwutil.c	2016-11-23 07:34:29 UTC (rev 15244)
@@ -78,53 +78,6 @@
 };
 
 /*
- * Default lwnotice/lwerror handlers
- *
- * Since variadic functions cannot pass their parameters directly, we need
- * wrappers for these functions to convert the arguments into a va_list
- * structure.
- */
-
-void
-lwnotice(const char *fmt, ...)
-{
-	va_list ap;
-
-	va_start(ap, fmt);
-
-	/* Call the supplied function */
-	(*lwnotice_var)(fmt, ap);
-
-	va_end(ap);
-}
-
-void
-lwerror(const char *fmt, ...)
-{
-	va_list ap;
-
-	va_start(ap, fmt);
-
-	/* Call the supplied function */
-	(*lwerror_var)(fmt, ap);
-
-	va_end(ap);
-}
-
-void
-lwdebug(int level, const char *fmt, ...)
-{
-	va_list ap;
-
-	va_start(ap, fmt);
-
-	/* Call the supplied function */
-	(*lwdebug_var)(level, fmt, ap);
-
-	va_end(ap);
-}
-
-/*
  * Default allocators
  *
  * We include some default allocators that use malloc/free/realloc
@@ -152,6 +105,14 @@
 	return ret;
 }
 
+/*
+ * Default lwnotice/lwerror handlers
+ *
+ * Since variadic functions cannot pass their parameters directly, we need
+ * wrappers for these functions to convert the arguments into a va_list
+ * structure.
+ */
+
 static void
 default_noticereporter(const char *fmt, va_list ap)
 {
@@ -212,6 +173,47 @@
 	if ( debuglogger ) lwdebug_var = debuglogger;
 }
 
+void
+lwnotice(const char *fmt, ...)
+{
+	va_list ap;
+
+	va_start(ap, fmt);
+
+	/* Call the supplied function */
+	(*lwnotice_var)(fmt, ap);
+
+	va_end(ap);
+}
+
+void
+lwerror(const char *fmt, ...)
+{
+	va_list ap;
+
+	va_start(ap, fmt);
+
+	/* Call the supplied function */
+	(*lwerror_var)(fmt, ap);
+
+	va_end(ap);
+}
+
+void
+lwdebug(int level, const char *fmt, ...)
+{
+	va_list ap;
+
+	va_start(ap, fmt);
+
+	/* Call the supplied function */
+	(*lwdebug_var)(level, fmt, ap);
+
+	va_end(ap);
+}
+
+
+
 const char*
 lwtype_name(uint8_t type)
 {
@@ -391,7 +393,7 @@
       ( srid % ( SRID_MAXIMUM - SRID_USER_MAXIMUM - 1 ) );
 		lwnotice("SRID value %d > SRID_MAXIMUM converted to %d", srid, newsrid);
 	}
-	
+
 	return newsrid;
 }
 



More information about the postgis-tickets mailing list