瀏覽代碼

Fix "null values not initialized" bug in previous commit

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@34446 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 16 年之前
父節點
當前提交
5fea4e746b
共有 1 個文件被更改,包括 0 次插入30 次删除
  1. 0 30
      lib/gis/null_val.c

+ 0 - 30
lib/gis/null_val.c

@@ -24,11 +24,7 @@
 #include <grass/gis.h>
 #include <grass/glocale.h>
 
-/* Flag to indicate null patterns are initialized */
-static int initialized = FALSE;
-
 static int EmbedGivenNulls(void *, char *, RASTER_MAP_TYPE, int);
-static void InitError(void);
 
 /****************************************************************************
 * int EmbedGivenNulls (void *cell, char *nulls, RASTER_MAP_TYPE map_type,
@@ -77,27 +73,6 @@ static int EmbedGivenNulls(void *cell, char *nulls, RASTER_MAP_TYPE map_type,
     return 1;
 }
 
-/****************************************************************************
-* void InitError (void)
-*
-* PURPOSE: 	To print an error message and exit the program. This function
-*   	    	is called if something tries to access a null pattern before
-*   	    	it is initialized.
-* INPUT VARS:	none
-* RETURN VAL:	none
-*****************************************************************************/
-static void InitError(void)
-{
-    char errMsg[512];		/* array to hold error message */
-
-    strcpy(errMsg, _("Null values have not been initialized. "));
-    strcat(errMsg, _("G_gisinit() must be called first. "));
-    strcat(errMsg, _("Please advise GRASS developers of this error.\n"));
-    G_fatal_error(errMsg);
-
-    return;
-}
-
 /*========================== Library Functions =============================*/
 
 /****************************************************************************
@@ -273,11 +248,6 @@ int G_is_c_null_value(const CELL * cellVal)
 {
     int i;			/* counter */
 
-    /* Check if the null patterns have been initialized */
-    if (!initialized) {
-	InitError();
-    }
-
     /* Check if the CELL value matches the null pattern */
     for (i = 0; i < sizeof(CELL); i++)
 	if (cellVal[i] != (CELL) 0x80000000)