jonathan: thuban/libraries/thuban gdalwarp.cpp,1.5,1.6

cvs@intevation.de cvs at intevation.de
Mon Feb 7 20:51:15 CET 2005


Author: jonathan

Update of /thubanrepository/thuban/libraries/thuban
In directory doto:/tmp/cvs-serv16480/libraries/thuban

Modified Files:
	gdalwarp.cpp 
Log Message:
Removed unnecessary/unused macros.


Index: gdalwarp.cpp
===================================================================
RCS file: /thubanrepository/thuban/libraries/thuban/gdalwarp.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gdalwarp.cpp	28 Jan 2005 19:10:07 -0000	1.5
+++ gdalwarp.cpp	7 Feb 2005 19:51:13 -0000	1.6
@@ -29,6 +29,9 @@
  ******************************************************************************
  *
  * $Log$
+ * Revision 1.6  2005/02/07 19:51:13  jonathan
+ * Removed unnecessary/unused macros.
+ *
  * Revision 1.5  2005/01/28 19:10:07  jonathan
  * Recoded how the mask is packed into the bit array.
  *
@@ -132,12 +135,6 @@
     {const char *str = CPLGetLastErrorMsg(); \
         str != NULL ? PyErr_SetString(x, str) : PyErr_SetString(x, "");}
 
-#define PYTHON_ERR(n, str) \
-    {if (str != NULL) PyErr_SetString(n, "");}
-
-#define PYTHON_ERRF(n, str, ...) \
-    {if (str != NULL) PyErr_Format(n, str, ## __VA_ARGS__);}
-
 #define LEAVE_NOW(e) { err = e; goto getOut; }
 
 #define OPTS_MASK  1
@@ -260,7 +257,7 @@
     int nRasterYSize = ds->GetRasterYSize();
     if ( ! (nRasterXSize > 0 && nRasterYSize > 0 ))
     {
-        PYTHON_ERRF(PyExc_ValueError, 
+        PyErr_Format(PyExc_ValueError, 
                 "The dimensions (%ix%i) are invalid in %s", 
                 nRasterXSize, nRasterYSize, pszSrcFilename);
         return CE_Failure;
@@ -273,7 +270,7 @@
     *imgbuf = (unsigned char*)CPLMalloc(*imglen);
     if ( *imgbuf == NULL ) 
     {
-        PYTHON_ERRF(PyExc_MemoryError, 
+        PyErr_Format(PyExc_MemoryError, 
                 "The system does not have enough memory to project %s", 
                 pszSrcFilename);
         return CE_Failure;
@@ -313,7 +310,7 @@
                                      GDT_Byte, 3, 0);
                 if (ret == CE_Failure)
                 {
-                    PYTHON_ERRF(PyExc_IOError, 
+                    PyErr_Format(PyExc_IOError, 
                         "An unknown error occured while reading band %i in %s",
                         i, pszSrcFilename);
                     break;
@@ -337,7 +334,7 @@
                 
                 if (pal == NULL)
                 {
-                    PYTHON_ERRF(PyExc_IOError, 
+                    PyErr_Format(PyExc_IOError, 
                         "Couldn't find a palette for palette-based image %s", 
                         pszSrcFilename);
                     ret = CE_Failure;
@@ -359,7 +356,7 @@
                             
                     if (ret == CE_Failure) 
                     {
-                        PYTHON_ERRF(PyExc_IOError, 
+                        PyErr_Format(PyExc_IOError, 
                             "An unknown error occured while reading band 1 in %s", pszSrcFilename);
                         break;
                     }
@@ -404,7 +401,7 @@
                         
                 if (ret == CE_Failure) 
                 {
-                    PYTHON_ERRF(PyExc_IOError, 
+                    PyErr_Format(PyExc_IOError, 
                         "An unknown error occured while reading band 1 in %s", 
                         pszSrcFilename);
                     break;
@@ -423,7 +420,7 @@
                 break;
 
             default:
-                PYTHON_ERRF(PyExc_ValueError, 
+                PyErr_Format(PyExc_ValueError, 
                     "Unsupported color interpretation '%s' in image %s", 
                     GDALGetColorInterpretationName(
                         band->GetColorInterpretation()),
@@ -435,7 +432,7 @@
     }
     else
     {
-        PYTHON_ERRF(PyExc_ValueError, 
+        PyErr_Format(PyExc_ValueError, 
                   "Unsupported number of raster bands (%i) in image %s\n",
                   rasterCount, pszSrcFilename);
 
@@ -667,7 +664,7 @@
 
     if( pszTargetSRS != NULL && strlen(pszSourceSRS) == 0 )
     {
-        PYTHON_ERRF(PyExc_ValueError, 
+        PyErr_Format(PyExc_ValueError, 
             "A target projection was specified, "
             "but there is no source projection in %s", pszSrcFilename );
         LEAVE_NOW( 1 );
@@ -707,7 +704,7 @@
 
     if( hDstDS == NULL )
     {
-        PYTHON_ERRF(PyExc_IOError, 
+        PyErr_Format(PyExc_IOError, 
             "Error creating destination image for projecting %s",
             pszSrcFilename);
         LEAVE_NOW( CPLE_FileIO );





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)