Skip to content

Commit

Permalink
Avoid future variable declaration after statements errors on windows (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed Sep 9, 2015
1 parent 9c1abfc commit 219e54b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ set_target_properties(mapcache PROPERTIES
SOVERSION 1
)

# Add compiler flags for warnings
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror=declaration-after-statement")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()

#options suported by the cmake builder
option(WITH_PIXMAN "Use pixman for SSE optimized image manipulations" ON)
option(WITH_SQLITE "Use sqlite as a cache backend" ON)
Expand Down
7 changes: 4 additions & 3 deletions lib/cache_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,16 +497,19 @@ static void _mapcache_cache_disk_set(mapcache_context *ctx, mapcache_cache *pcac
}
if(mapcache_image_blank_color(tile->raw_image) != MAPCACHE_FALSE) {
char *blankname;
int retry_count_create_symlink = 0;
char *blankname_rel = NULL;
_mapcache_cache_disk_blank_tile_key(ctx,cache,tile,tile->raw_image->data,&blankname);
if(apr_file_open(&f, blankname, APR_FOPEN_READ, APR_OS_DEFAULT, ctx->pool) != APR_SUCCESS) {
int isLocked;
void *lock;
char *blankdirname;
if(!tile->encoded_data) {
tile->encoded_data = tile->tileset->format->write(ctx, tile->raw_image, tile->tileset->format);
GC_CHECK_ERROR(ctx);
}
/* create the blank file */
char *blankdirname = apr_psprintf(ctx->pool, "%s/%s/%s/blanks",
blankdirname = apr_psprintf(ctx->pool, "%s/%s/%s/blanks",
cache->base_directory,
tile->tileset->name,
tile->grid_link->grid->name);
Expand Down Expand Up @@ -554,12 +557,10 @@ static void _mapcache_cache_disk_set(mapcache_context *ctx, mapcache_cache *pcac
apr_file_close(f);
}

int retry_count_create_symlink = 0;

/*
* compute the relative path between tile and blank tile
*/
char *blankname_rel = NULL;
blankname_rel = relative_path(ctx,filename, blankname);
GC_CHECK_ERROR(ctx);

Expand Down
3 changes: 2 additions & 1 deletion util/mapcache_seed.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ cmd mode = MAPCACHE_CMD_SEED; /* the mode the utility will be running in: either

int push_queue(struct seed_cmd cmd)
{
struct seed_cmd *pcmd;
#ifdef USE_FORK
if(nprocesses > 1) {
struct msg_cmd mcmd;
Expand All @@ -149,7 +150,7 @@ int push_queue(struct seed_cmd cmd)
return APR_SUCCESS;
}
#endif
struct seed_cmd *pcmd = calloc(1,sizeof(struct seed_cmd));
pcmd = calloc(1,sizeof(struct seed_cmd));
*pcmd = cmd;
return apr_queue_push(work_queue,pcmd);
}
Expand Down

0 comments on commit 219e54b

Please sign in to comment.