Skip to content
Permalink
Browse files
Fix MSVC warnings in programs and Python mapscript
  • Loading branch information
rouault committed Jan 17, 2020
1 parent 5a48283 commit 113e8475c9f9904482065154b746120591aa1100
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
@@ -255,8 +255,8 @@ def fromstring(data, mappath=None):
}

int setLayerOrder(PyObject *order) {
int i, size;
size = PyTuple_Size(order);
int i;
Py_ssize_t size = PyTuple_Size(order);
for (i = 0; i < size; i++) {
self->layerorder[i] = (int)PyInt_AsLong(PyTuple_GetItem(order, i));
}
@@ -39,7 +39,7 @@
PyErr_SetString(PyExc_TypeError, "not a sequence");
SWIG_fail;
}
$1 = PySequence_Size($input);
$1 = (int) PySequence_Size($input);
$2 = (double*) malloc($1*sizeof(double));
for( i = 0; i<$1; i++ ) {
PyObject *o = PySequence_GetItem($input,i);
@@ -100,7 +100,7 @@ CreateTupleFromDoubleArray( double *first, unsigned int size ) {
if (PyDict_Check($input)) {

int i = 0;
int size = PyDict_Size($input);
int size = (int) PyDict_Size($input);

PyObject* keys = PyDict_Keys($input);
PyObject* values = PyDict_Values($input);
@@ -26,7 +26,14 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/

#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500 // for putenv
#endif

#include "mapserver-config.h"
#include <stdlib.h>

#ifdef USE_FASTCGI
#define NO_FCGI_DEFINES
#include "fcgi_stdio.h"
@@ -41,7 +48,6 @@
#endif



/************************************************************************/
/* FastCGI cleanup functions. */
/************************************************************************/
@@ -73,7 +79,7 @@ void msCleanupOnExit( void )
fprintf( fp_out, "In msCleanupOnExit\n" );
fclose( fp_out );
#endif
msCleanup(1);
msCleanup();
}
#endif

@@ -88,7 +94,7 @@ void msCleanupOnExit( void )
static int msIO_fcgiRead( void *cbData, void *data, int byteCount )

{
return FCGI_fread( data, 1, byteCount, (FCGI_FILE *) cbData );
return (int) FCGI_fread( data, 1, byteCount, (FCGI_FILE *) cbData );
}

/************************************************************************/
@@ -100,7 +106,7 @@ static int msIO_fcgiRead( void *cbData, void *data, int byteCount )
static int msIO_fcgiWrite( void *cbData, void *data, int byteCount )

{
return FCGI_fwrite( data, 1, byteCount, (FCGI_FILE *) cbData );
return (int) FCGI_fwrite( data, 1, byteCount, (FCGI_FILE *) cbData );
}

/************************************************************************/
@@ -44,7 +44,7 @@ char* AddFileSuffix ( const char * Filename, const char * Suffix )
/* -------------------------------------------------------------------- */
pszBasename = (char *) msSmallMalloc(strlen(Filename)+5);
strcpy( pszBasename, Filename );
for( i = strlen(pszBasename)-1;
for( i = (int)strlen(pszBasename)-1;
i > 0 && pszBasename[i] != '.' && pszBasename[i] != '/'
&& pszBasename[i] != '\\';
i-- ) {}
@@ -55,7 +55,7 @@ char* AddFileSuffix ( const char * Filename, const char * Suffix )
/* -------------------------------------------------------------------- */
pszBasename = (char *) msSmallMalloc(strlen(Filename)+5);
strcpy( pszBasename, Filename );
for( i = strlen(pszBasename)-1;
for( i = (int)strlen(pszBasename)-1;
i > 0 && pszBasename[i] != '.' && pszBasename[i] != '/'
&& pszBasename[i] != '\\';
i-- ) {}
@@ -131,7 +131,7 @@ int main(int argc, char *argv[])

for(i=0; i<num_fields; i++) {
msDBFGetFieldInfo(inDBF,i,fName,NULL,NULL);
if(strncasecmp(argv[3],fName,strlen(argv[3])) == 0) { /* ---- Found it ---- */
if(strncasecmp(argv[3],fName,(int)strlen(argv[3])) == 0) { /* ---- Found it ---- */
fieldNumber = i;
break;
}

0 comments on commit 113e847

Please sign in to comment.