X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/1fe49af0ed8ab6c226fd2b3486851a395ee657ab..58a642b6002c2a326b71e4e3b5977bf6cabd0829:/src/mapcache.c diff --git a/src/mapcache.c b/src/mapcache.c index 6df3d8c1..9d429c43 100644 --- a/src/mapcache.c +++ b/src/mapcache.c @@ -122,7 +122,7 @@ void a_mapcache_add ( GdkPixbuf *pixbuf, gint x, gint y, gint z, guint8 type, gu /* business as usual */ } - if ( (++tmp == 100 )) { g_print("DEBUG: queue count=%d %ld\n", queue_count, queue_size ); tmp=0; } + if ( (++tmp == 100 )) { g_print("DEBUG: queue count=%d %u\n", queue_count, queue_size ); tmp=0; } } GdkPixbuf *a_mapcache_get ( gint x, gint y, gint z, guint8 type, guint zoom, guint8 alpha, gdouble xshrinkfactor, gdouble yshrinkfactor ) @@ -132,7 +132,7 @@ GdkPixbuf *a_mapcache_get ( gint x, gint y, gint z, guint8 type, guint zoom, gui return g_hash_table_lookup ( cache, key ); } -void a_mapcache_remove_all_shrinkfactors ( guint16 x, guint16 y, guint16 z, guint8 type, guint zoom ) +void a_mapcache_remove_all_shrinkfactors ( gint x, gint y, gint z, guint8 type, guint zoom ) { char key[40]; List *loop = queue_tail; @@ -151,10 +151,13 @@ void a_mapcache_remove_all_shrinkfactors ( guint16 x, guint16 y, guint16 z, guin if ( strncmp(tmp->key, key, len) == 0 ) { g_hash_table_remove ( cache, tmp->key ); - if ( tmp == loop ) + if ( tmp == loop ) /* we deleted the last thing in the queue! */ loop = queue_tail = NULL; - else + else { loop->next = tmp->next; + if ( tmp == queue_tail ) + queue_tail = tmp->next; + } g_free ( tmp ); tmp = NULL; }