Skip to content

Commit

Permalink
Fix usage of FILE* and VSILFILE*
Browse files Browse the repository at this point in the history
In GDAL 3.7dev, VSILFILE* is no longer an alias for FILE* (see
OSGeo/gdal#6883), so we have to adjust our
usage to be correct.

This MapServer change is backward compatible with GDAL < 3.7 too
  • Loading branch information
rouault authored and github-actions[bot] committed Dec 15, 2022
1 parent e056f4a commit c1ec025
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mapcontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ int msLoadMapContext(mapObj *map, char *filename, int unique_layer_names)
int msSaveMapContext(mapObj *map, char *filename)
{
#if defined(USE_WMS_LYR)
VSILFILE *stream;
FILE *stream;
char szPath[MS_MAXPATHLEN];
int nStatus;

Expand Down
2 changes: 1 addition & 1 deletion mapgdal.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ int msSaveImageGDAL( mapObj *map, imageObj *image, const char *filenameIn )
/* stdout and delete the file. */
/* -------------------------------------------------------------------- */
if( bFileIsTemporary ) {
FILE *fp;
VSILFILE *fp;
unsigned char block[4000];
int bytes_read;

Expand Down
6 changes: 3 additions & 3 deletions mapogroutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )
else if( EQUAL(form,"simple") ) {
char buffer[1024];
int bytes_read;
FILE *fp;
VSILFILE *fp;
const char *jsonp;

jsonp = msGetOutputFormatOption( format, "JSONP", NULL );
Expand Down Expand Up @@ -1270,7 +1270,7 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )
CSLDestroy(papszAdditionalFiles);

for( i = 0; file_list != NULL && file_list[i] != NULL; i++ ) {
FILE *fp;
VSILFILE *fp;
int bytes_read;
char buffer[1024];

Expand Down Expand Up @@ -1307,7 +1307,7 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )
/* Handle the case of a zip file result. */
/* -------------------------------------------------------------------- */
else if( EQUAL(form,"zip") ) {
FILE *fp;
VSILFILE *fp;
char *zip_filename = msTmpFile(map, NULL, "/vsimem/ogrzip/", "zip" );
void *hZip;
int bytes_read;
Expand Down
2 changes: 1 addition & 1 deletion mapwcs11.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ int msWCSReturnCoverage11( wcsParamsObj *params, mapObj *map,

for( i = 0; i < count; i++ ) {
const char *mimetype = NULL;
FILE *fp;
VSILFILE *fp;
unsigned char block[4000];
int bytes_read;

Expand Down
2 changes: 1 addition & 1 deletion mapwcs20.c
Original file line number Diff line number Diff line change
Expand Up @@ -2446,7 +2446,7 @@ static int msWCSWriteFile20(mapObj* map, imageObj* image, wcs20ParamsObjPtr para

for( i = 0; i < count; i++ ) {
const char *mimetype = NULL;
FILE *fp;
VSILFILE *fp;
unsigned char block[4000];
int bytes_read;

Expand Down
2 changes: 1 addition & 1 deletion mapwmslayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ int msDrawWMSLayerLow(int nLayerId, httpRequestObj *pasReqInfo,
if (msDrawLayer(map, lp, img) != 0)
status = MS_FAILURE;
} else {
FILE *fp;
VSILFILE *fp;
char *wldfile;
/* OK, we have to resample the raster to map projection... */
lp->transform = MS_TRUE;
Expand Down

0 comments on commit c1ec025

Please sign in to comment.