]> granicus.if.org Git - postgis/commitdiff
Reorganize code to make comments have more sense
authorSandro Santilli <strk@kbt.io>
Wed, 23 Nov 2016 07:34:29 +0000 (07:34 +0000)
committerSandro Santilli <strk@kbt.io>
Wed, 23 Nov 2016 07:34:29 +0000 (07:34 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@15244 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwutil.c

index 282986bfab1aff5deaeb3541a34ba5ace4dd1ec3..804cf34f1db03473ebb68edb7a37bb1c3da78308 100644 (file)
@@ -77,53 +77,6 @@ static char *lwgeomTypeName[] =
        "Tin"
 };
 
-/*
- * 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
  *
@@ -152,6 +105,14 @@ default_reallocator(void *mem, size_t size)
        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 @@ lwgeom_set_debuglogger(lwdebuglogger debuglogger) {
        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 @@ clamp_srid(int srid)
       ( srid % ( SRID_MAXIMUM - SRID_USER_MAXIMUM - 1 ) );
                lwnotice("SRID value %d > SRID_MAXIMUM converted to %d", srid, newsrid);
        }
-       
+
        return newsrid;
 }