summaryrefslogtreecommitdiff
path: root/navit/map/binfile/binfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'navit/map/binfile/binfile.c')
-rw-r--r--navit/map/binfile/binfile.c184
1 files changed, 92 insertions, 92 deletions
diff --git a/navit/map/binfile/binfile.c b/navit/map/binfile/binfile.c
index 93cbbd466..cd6fec8dc 100644
--- a/navit/map/binfile/binfile.c
+++ b/navit/map/binfile/binfile.c
@@ -240,9 +240,9 @@ binfile_read_eoc(struct file *fi)
eoc=(struct zip_eoc *)file_data_read(fi,fi->size-sizeof(struct zip_eoc), sizeof(struct zip_eoc));
if (eoc) {
eoc_to_cpu(eoc);
- dbg(lvl_debug,"sig 0x%x\n", eoc->zipesig);
+ dbg(lvl_debug,"sig 0x%x", eoc->zipesig);
if (eoc->zipesig != zip_eoc_sig) {
- dbg(lvl_error,"map file %s: eoc signature check failed: 0x%x vs 0x%x\n", fi->name, eoc->zipesig,zip_eoc_sig);
+ dbg(lvl_error,"map file %s: eoc signature check failed: 0x%x vs 0x%x", fi->name, eoc->zipesig,zip_eoc_sig);
file_data_free(fi,(unsigned char *)eoc);
eoc=NULL;
}
@@ -258,20 +258,20 @@ binfile_read_eoc64(struct file *fi)
eocl=(struct zip64_eocl *)file_data_read(fi,fi->size-sizeof(struct zip_eoc)-sizeof(struct zip64_eocl), sizeof(struct zip64_eocl));
if (!eocl)
return NULL;
- dbg(lvl_debug,"sig 0x%x\n", eocl->zip64lsig);
+ dbg(lvl_debug,"sig 0x%x", eocl->zip64lsig);
if (eocl->zip64lsig != zip64_eocl_sig) {
file_data_free(fi,(unsigned char *)eocl);
- dbg(lvl_warning,"map file %s: eocl wrong\n", fi->name);
+ dbg(lvl_warning,"map file %s: eocl wrong", fi->name);
return NULL;
}
eoc=(struct zip64_eoc *)file_data_read(fi,eocl->zip64lofst, sizeof(struct zip64_eoc));
if (eoc) {
if (eoc->zip64esig != zip64_eoc_sig) {
file_data_free(fi,(unsigned char *)eoc);
- dbg(lvl_warning,"map file %s: eoc wrong\n", fi->name);
+ dbg(lvl_warning,"map file %s: eoc wrong", fi->name);
eoc=NULL;
}
- dbg(lvl_debug,"eoc64 ok 0x"LONGLONG_HEX_FMT " 0x"LONGLONG_HEX_FMT "\n",eoc->zip64eofst,eoc->zip64ecsz);
+ dbg(lvl_debug,"eoc64 ok 0x"LONGLONG_HEX_FMT " 0x"LONGLONG_HEX_FMT "",eoc->zip64eofst,eoc->zip64ecsz);
}
file_data_free(fi,(unsigned char *)eocl);
return eoc;
@@ -296,9 +296,9 @@ binfile_read_cd(struct map_priv *m, int offset, int len)
}
cd=(struct zip_cd *)file_data_read(m->fi,cdoffset+offset, sizeof(*cd)+len);
if (cd) {
- dbg(lvl_debug,"cd at "LONGLONG_FMT" %zu bytes\n",cdoffset+offset, sizeof(*cd)+len);
+ dbg(lvl_debug,"cd at "LONGLONG_FMT" %zu bytes",cdoffset+offset, sizeof(*cd)+len);
cd_to_cpu(cd);
- dbg(lvl_debug,"sig 0x%x\n", cd->zipcensig);
+ dbg(lvl_debug,"sig 0x%x", cd->zipcensig);
if (cd->zipcensig != zip_cd_sig) {
file_data_free(m->fi,(unsigned char *)cd);
cd=NULL;
@@ -375,7 +375,7 @@ binfile_read_content(struct map_priv *m, struct file *fi, long long offset, stru
ret=file_data_read_compressed(fi,offset, lfh->zipsize, lfh->zipuncmp);
break;
default:
- dbg(lvl_error,"map file %s: unknown compression method %d\n", fi->name, lfh->zipmthd);
+ dbg(lvl_error,"map file %s: unknown compression method %d", fi->name, lfh->zipmthd);
}
return ret;
}
@@ -389,7 +389,7 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
long long cdoffset=m->eoc64?m->eoc64->zip64eofst:m->eoc->zipeofst;
struct zip_cd *cd;
#if 0
- dbg(lvl_debug,"end=%d\n",end);
+ dbg(lvl_debug,"end=%d",end);
#endif
while (offset < end) {
cd=(struct zip_cd *)(m->search_data+offset-m->search_offset);
@@ -399,7 +399,7 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
offset-m->search_offset+sizeof(*cd)+cd->zipcfnl+cd->zipcxtl > m->search_size
) {
#if 0
- dbg(lvl_debug,"reload %p %d %d\n", m->search_data, m->search_offset, offset);
+ dbg(lvl_debug,"reload %p %d %d", m->search_data, m->search_offset, offset);
#endif
if (m->search_data)
file_data_free(m->fi,m->search_data);
@@ -411,8 +411,8 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
cd=(struct zip_cd *)m->search_data;
}
#if 0
- dbg(lvl_debug,"offset=%d search_offset=%d search_size=%d search_data=%p cd=%p\n", offset, m->search_offset, m->search_size, m->search_data, cd);
- dbg(lvl_debug,"offset=%d fn='%s'\n",offset,cd->zipcfn);
+ dbg(lvl_debug,"offset=%d search_offset=%d search_size=%d search_data=%p cd=%p", offset, m->search_offset, m->search_size, m->search_data, cd);
+ dbg(lvl_debug,"offset=%d fn='%s'",offset,cd->zipcfn);
#endif
if (!skip &&
(partial || cd->zipcfnl == len) &&
@@ -428,7 +428,7 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
static void
map_destroy_binfile(struct map_priv *m)
{
- dbg(lvl_debug,"map_destroy_binfile\n");
+ dbg(lvl_debug,"map_destroy_binfile");
if (m->fi)
map_binfile_close(m);
map_binfile_destroy(m);
@@ -523,7 +523,7 @@ binfile_extract(struct map_priv *m, char *dir, char *filename, int partial)
if (full[len-2] != '/') {
lfh=binfile_read_lfh(m->fi, binfile_cd_offset(cd));
start=binfile_read_content(m, m->fi, binfile_cd_offset(cd), lfh);
- dbg(lvl_debug,"fopen '%s'\n", full);
+ dbg(lvl_debug,"fopen '%s'", full);
f=fopen(full,"w");
fwrite(start, lfh->zipuncmp, 1, f);
fclose(f);
@@ -569,7 +569,7 @@ binfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
mr->label_attr[4]=t->pos_attr;
if (type == attr_type || attr_type == attr_any) {
if (attr_type == attr_any) {
- dbg(lvl_debug,"pos %p attr %s size %d\n", t->pos_attr-1, attr_to_name(type), size);
+ dbg(lvl_debug,"pos %p attr %s size %d", t->pos_attr-1, attr_to_name(type), size);
}
attr->type=type;
if (ATTR_IS_GROUP(type)) {
@@ -647,13 +647,13 @@ binfile_item_dup(struct map_priv *m, struct item *item, struct tile *t, int exte
entry->id.id_hi=item->id_hi;
entry->id.id_lo=item->id_lo;
entry->flags=1;
- dbg(lvl_debug,"id 0x%x,0x%x\n",entry->id.id_hi,entry->id.id_lo);
+ dbg(lvl_debug,"id 0x%x,0x%x",entry->id.id_hi,entry->id.id_lo);
memcpy(ret, t->pos, (size+1)*sizeof(int));
if (!m->changes)
m->changes=g_hash_table_new_full(binfile_hash_entry_hash, binfile_hash_entry_equal, g_free, NULL);
g_hash_table_replace(m->changes, entry, entry);
- dbg(lvl_debug,"ret %p\n",ret);
+ dbg(lvl_debug,"ret %p",ret);
return ret;
}
@@ -668,15 +668,15 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
{
int *i=t->pos,j=0;
- dbg(lvl_debug,"Before: pos_coord=%td\n",t->pos_coord-i);
+ dbg(lvl_debug,"Before: pos_coord=%td",t->pos_coord-i);
while (i < t->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
aoffset=t->pos_attr-t->pos_attr_start;
coffset=t->pos_coord-t->pos_coord_start-2;
clen=t->pos_attr_start-t->pos_coord+2;
- dbg(lvl_debug,"coffset=%d clen=%d\n",coffset,clen);
+ dbg(lvl_debug,"coffset=%d clen=%d",coffset,clen);
switch (mode) {
case change_mode_delete:
if (count*2 > clen)
@@ -713,7 +713,7 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
default:
return 0;
}
- dbg(lvl_debug,"delta %d\n",delta);
+ dbg(lvl_debug,"delta %d",delta);
data=binfile_item_dup(mr->m, &mr->item, t, delta > 0 ? delta:0);
data[0]=cpu_to_le32(le32_to_cpu(data[0])+delta);
data[2]=cpu_to_le32(le32_to_cpu(data[2])+delta);
@@ -725,18 +725,18 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
tn=mr->t;
tn->pos_coord=tn->pos_coord_start+coffset;
tn->pos_attr=tn->pos_attr_start+aoffset;
- dbg(lvl_debug,"moving %d ints from offset %td to %td\n",move_len,tn->pos_coord_start+move_offset-data,tn->pos_coord_start+move_offset+delta-data);
+ dbg(lvl_debug,"moving %d ints from offset %td to %td",move_len,tn->pos_coord_start+move_offset-data,tn->pos_coord_start+move_offset+delta-data);
memmove(tn->pos_coord_start+move_offset+delta, tn->pos_coord_start+move_offset, move_len*4);
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After move: pos_coord=%td\n",tn->pos_coord-i);
+ dbg(lvl_debug,"After move: pos_coord=%td",tn->pos_coord-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
if (mode != change_mode_append)
tn->pos_coord+=move_offset;
if (mode != change_mode_delete) {
- dbg(lvl_debug,"writing %d ints at offset %td\n",count*2,write_offset+tn->pos_coord_start-data);
+ dbg(lvl_debug,"writing %d ints at offset %td",count*2,write_offset+tn->pos_coord_start-data);
for (i = 0 ; i < count ; i++) {
tn->pos_coord_start[write_offset++]=c[i].x;
tn->pos_coord_start[write_offset++]=c[i].y;
@@ -745,9 +745,9 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
}
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After: pos_coord=%td\n",tn->pos_coord-i);
+ dbg(lvl_debug,"After: pos_coord=%td",tn->pos_coord-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
return 1;
}
@@ -764,9 +764,9 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
{
int *i=t->pos,j=0;
- dbg(lvl_debug,"Before: pos_attr=%td\n",t->pos_attr-i);
+ dbg(lvl_debug,"Before: pos_attr=%td",t->pos_attr-i);
while (i < t->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
@@ -777,7 +777,7 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
oattr_len=0;
if (!naoffset) {
if (mode == change_mode_delete || mode == change_mode_modify) {
- dbg(lvl_error,"no attribute selected\n");
+ dbg(lvl_error,"no attribute selected");
return 0;
}
if (mode == change_mode_append)
@@ -785,7 +785,7 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
}
while (offset < naoffset) {
oattr_len=le32_to_cpu(t->pos_attr_start[offset])+1;
- dbg(lvl_debug,"len %d\n",oattr_len);
+ dbg(lvl_debug,"len %d",oattr_len);
write_offset=offset;
offset+=oattr_len;
}
@@ -818,7 +818,7 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
delta=nattr_len-oattr_len;
else
delta=nattr_len;
- dbg(lvl_debug,"delta %d oattr_len %d nattr_len %d\n",delta,oattr_len, nattr_len);
+ dbg(lvl_debug,"delta %d oattr_len %d nattr_len %d",delta,oattr_len, nattr_len);
data=binfile_item_dup(mr->m, &mr->item, t, delta > 0 ? delta:0);
data[0]=cpu_to_le32(le32_to_cpu(data[0])+delta);
new.pos=new.start=data;
@@ -829,20 +829,20 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
tn=mr->t;
tn->pos_coord=tn->pos_coord_start+coffset;
tn->pos_attr=tn->pos_attr_start+offset;
- dbg(lvl_debug,"attr start %td offset %d\n",tn->pos_attr_start-data,offset);
- dbg(lvl_debug,"moving %d ints from offset %td to %td\n",move_len,tn->pos_attr_start+move_offset-data,tn->pos_attr_start+move_offset+delta-data);
+ dbg(lvl_debug,"attr start %td offset %d",tn->pos_attr_start-data,offset);
+ dbg(lvl_debug,"moving %d ints from offset %td to %td",move_len,tn->pos_attr_start+move_offset-data,tn->pos_attr_start+move_offset+delta-data);
memmove(tn->pos_attr_start+move_offset+delta, tn->pos_attr_start+move_offset, move_len*4);
if (mode != change_mode_append)
tn->pos_attr+=delta;
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After move: pos_attr=%td\n",tn->pos_attr-i);
+ dbg(lvl_debug,"After move: pos_attr=%td",tn->pos_attr-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
if (nattr_len) {
int *nattr=tn->pos_attr_start+write_offset;
- dbg(lvl_debug,"writing %d ints at %td\n",nattr_len,nattr-data);
+ dbg(lvl_debug,"writing %d ints at %td",nattr_len,nattr-data);
nattr[0]=cpu_to_le32(nattr_len-1);
nattr[1]=cpu_to_le32(attr->type);
memcpy(nattr+2, attr_data_get(attr), nattr_size);
@@ -850,11 +850,11 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
}
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After: pos_attr=%td\n",tn->pos_attr-i);
+ dbg(lvl_debug,"After: pos_attr=%td",tn->pos_attr-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"After: pos_attr=%td\n",tn->pos_attr-i);
+ dbg(lvl_debug,"After: pos_attr=%td",tn->pos_attr-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
return 1;
}
@@ -891,7 +891,7 @@ pop_tile(struct map_rect_priv *mr)
file_data_free(mr->m->fi, (unsigned char *)(mr->t->start));
#ifdef DEBUG_SIZE
#if DEBUG_SIZE > 0
- dbg(lvl_debug,"leave %d\n",mr->t->zipfile_num);
+ dbg(lvl_debug,"leave %d",mr->t->zipfile_num);
#endif
#endif
mr->t=&mr->tiles[--mr->tile_depth-1];
@@ -906,8 +906,8 @@ zipfile_to_tile(struct map_priv *m, struct zip_cd *cd, struct tile *t)
struct zip_lfh *lfh;
char *zipfn;
struct file *fi;
- dbg(lvl_debug,"enter %p %p %p\n", m, cd, t);
- dbg(lvl_debug,"cd->zipofst=0x"LONGLONG_HEX_FMT "\n", binfile_cd_offset(cd));
+ dbg(lvl_debug,"enter %p %p %p", m, cd, t);
+ dbg(lvl_debug,"cd->zipofst=0x"LONGLONG_HEX_FMT "", binfile_cd_offset(cd));
t->start=NULL;
t->mode=1;
if (m->fis)
@@ -938,7 +938,7 @@ map_binfile_handle_redirect(struct map_priv *m)
if (m->redirect)
return 0;
m->redirect=1;
- dbg(lvl_debug,"redirected from %s to %s\n",m->url,location);
+ dbg(lvl_debug,"redirected from %s to %s",m->url,location);
g_free(m->url);
m->url=g_strdup(location);
file_destroy(m->http);
@@ -987,7 +987,7 @@ map_binfile_download_size(struct map_priv *m)
} while (map_binfile_handle_redirect(m));
ret=file_size(m->http);
- dbg(lvl_debug,"file size "LONGLONG_FMT"\n",ret);
+ dbg(lvl_debug,"file size "LONGLONG_FMT"",ret);
return ret;
}
@@ -1033,7 +1033,7 @@ map_binfile_download_range(struct map_priv *m, long long offset, int size)
ret=file_data_read_special(http, size, &size_ret);
if (size_ret != size) {
- dbg(lvl_debug,"size %d vs %d\n",size,size_ret);
+ dbg(lvl_debug,"size %d vs %d",size,size_ret);
g_free(ret);
return NULL;
}
@@ -1047,7 +1047,7 @@ download_cd(struct map_download *download)
struct zip64_eoc *zip64_eoc=(struct zip64_eoc *)file_data_read(m->fi, 0, sizeof(*zip64_eoc));
struct zip_cd *cd=(struct zip_cd *)map_binfile_download_range(m, zip64_eoc->zip64eofst+download->zipfile*m->cde_size,m->cde_size);
file_data_free(m->fi, (unsigned char *)zip64_eoc);
- dbg(lvl_debug,"needed cd, result %p\n",cd);
+ dbg(lvl_debug,"needed cd, result %p",cd);
return cd;
}
@@ -1061,7 +1061,7 @@ download_request(struct map_download *download)
if(!download->m->download_enabled)
{
- dbg(lvl_error,"Tried downloading while it's not allowed\n");
+ dbg(lvl_error,"Tried downloading while it's not allowed");
return 0;
}
attrs[0]=&url;
@@ -1080,7 +1080,7 @@ download_request(struct map_download *download)
attrs[3]=NULL;
download->dl_size=size;
}
- dbg(lvl_debug,"encountered missing tile %d %s(%s), Downloading %d bytes at "LONGLONG_FMT"\n",download->zipfile, url.u.str,(char *)(download->cd_copy+1), download->dl_size, download->offset);
+ dbg(lvl_debug,"encountered missing tile %d %s(%s), Downloading %d bytes at "LONGLONG_FMT"",download->zipfile, url.u.str,(char *)(download->cd_copy+1), download->dl_size, download->offset);
map_binfile_http_request(download->m, attrs);
g_free(url.u.str);
download->http=download->m->http;
@@ -1128,7 +1128,7 @@ download_download(struct map_download *download)
return 0;
}
- dbg(lvl_debug,"got %d bytes writing at offset "LONGLONG_FMT"\n",size_ret,download->offset);
+ dbg(lvl_debug,"got %d bytes writing at offset "LONGLONG_FMT"",size_ret,download->offset);
if (size_ret <= 0) {
g_free(data);
return 1;
@@ -1170,7 +1170,7 @@ download_finish(struct map_download *download)
g_free(download->cd_copy);
download->cd=(struct zip_cd *)(file_data_read(download->file, download->m->eoc->zipeofst + download->zipfile*download->m->cde_size, download->m->cde_size));
cd_to_cpu(download->cd);
- dbg(lvl_debug,"Offset %d\n",download->cd->zipofst);
+ dbg(lvl_debug,"Offset %d",download->cd->zipofst);
return 1;
}
@@ -1178,7 +1178,7 @@ static int
download_planet_size(struct map_download *download)
{
download->size=map_binfile_download_size(download->m);
- dbg(lvl_debug,"Planet size "LONGLONG_FMT"\n",download->size);
+ dbg(lvl_debug,"Planet size "LONGLONG_FMT"",download->size);
if (!download->size)
return 0;
return 1;
@@ -1194,7 +1194,7 @@ download_eoc(struct map_download *download)
download->zip_eoc=(struct zip_eoc *)(download->zip64_eocl+1);
if (download->zip64_eoc->zip64esig != zip64_eoc_sig || download->zip64_eocl->zip64lsig != zip64_eocl_sig || download->zip_eoc->zipesig != zip_eoc_sig)
{
- dbg(lvl_error,"wrong signature on zip64_eoc downloaded from "LONGLONG_FMT"\n",download->size-98);
+ dbg(lvl_error,"wrong signature on zip64_eoc downloaded from "LONGLONG_FMT"",download->size-98);
g_free(download->zip64_eoc);
return 0;
}
@@ -1221,11 +1221,11 @@ download_directory_do(struct map_download *download)
struct zip_cd *cd;
cd=(struct zip_cd *)file_data_read_special(download->http, sizeof(*cd), &size_ret);
cd->zipcunc=0;
- dbg(lvl_debug,"size_ret=%d\n",size_ret);
+ dbg(lvl_debug,"size_ret=%d",size_ret);
if (!size_ret)
return 0;
if (size_ret != sizeof(*cd) || cd->zipcensig != zip_cd_sig) {
- dbg(lvl_error,"error1 size=%d vs %zu\n",size_ret, sizeof(*cd));
+ dbg(lvl_error,"error1 size=%d vs %zu",size_ret, sizeof(*cd));
return 0;
}
file_data_write(download->file, download->offset, sizeof(*cd), (unsigned char *)cd);
@@ -1233,7 +1233,7 @@ download_directory_do(struct map_download *download)
cd_xlen=cd->zipcfnl+cd->zipcxtl;
cd_data=file_data_read_special(download->http, cd_xlen, &size_ret);
if (size_ret != cd_xlen) {
- dbg(lvl_error,"error2 size=%d vs %d\n",size_ret,cd_xlen);
+ dbg(lvl_error,"error2 size=%d vs %d",size_ret,cd_xlen);
return 0;
}
file_data_write(download->file, download->offset, cd_xlen, cd_data);
@@ -1278,14 +1278,14 @@ push_zipfile_tile_do(struct map_rect_priv *mr, struct zip_cd *cd, int zipfile, i
struct map_priv *m=mr->m;
struct file *f=m->fi;
- dbg(lvl_debug,"enter %p %d\n", mr, zipfile);
+ dbg(lvl_debug,"enter %p %d", mr, zipfile);
#ifdef DEBUG_SIZE
#if DEBUG_SIZE > 0
{
char filename[cd->zipcfnl+1];
memcpy(filename, cd+1, cd->zipcfnl);
filename[cd->zipcfnl]='\0';
- dbg(lvl_debug,"enter %d (%s) %d\n",zipfile, filename, cd->zipcunc);
+ dbg(lvl_debug,"enter %d (%s) %d",zipfile, filename, cd->zipcunc);
}
#endif
mr->size+=cd->zipcunc;
@@ -1341,10 +1341,10 @@ download(struct map_priv *m, struct map_rect_priv *mr, struct zip_cd *cd, int zi
return NULL;
}
for (;;) {
- dbg(lvl_debug,"state=%d\n",download->state);
+ dbg(lvl_debug,"state=%d",download->state);
switch (download->state) {
case 0:
- dbg(lvl_error,"error\n");
+ dbg(lvl_error,"error");
break;
case 1:
if (download_start(download))
@@ -1394,7 +1394,7 @@ download(struct map_priv *m, struct map_rect_priv *mr, struct zip_cd *cd, int zi
if (download_eoc(download))
download->state=6;
else {
- dbg(lvl_error,"download of eoc failed\n");
+ dbg(lvl_error,"download of eoc failed");
download->state=0;
}
break;
@@ -1443,7 +1443,7 @@ push_zipfile_tile(struct map_rect_priv *mr, int zipfile, int offset, int length,
struct file *f=m->fi;
long long cdoffset=m->eoc64?m->eoc64->zip64eofst:m->eoc->zipeofst;
struct zip_cd *cd=(struct zip_cd *)(file_data_read(f, cdoffset + zipfile*m->cde_size, m->cde_size));
- dbg(lvl_debug,"read from "LONGLONG_FMT" %d bytes\n",cdoffset + zipfile*m->cde_size, m->cde_size);
+ dbg(lvl_debug,"read from "LONGLONG_FMT" %d bytes",cdoffset + zipfile*m->cde_size, m->cde_size);
cd_to_cpu(cd);
if (!cd->zipcunc && m->url) {
cd=download(m, mr, cd, zipfile, offset, length, async);
@@ -1460,7 +1460,7 @@ map_rect_new_binfile_int(struct map_priv *map, struct map_selection *sel)
struct map_rect_priv *mr;
binfile_check_version(map);
- dbg(lvl_debug,"map_rect_new_binfile\n");
+ dbg(lvl_debug,"map_rect_new_binfile");
if (!map->fi && !map->url)
return NULL;
map_binfile_http_close(map);
@@ -1548,7 +1548,7 @@ map_rect_new_binfile(struct map_priv *map, struct map_selection *sel)
{
struct map_rect_priv *mr=map_rect_new_binfile_int(map, sel);
struct tile t;
- dbg(lvl_debug,"zip_members=%d\n", map->zip_members);
+ dbg(lvl_debug,"zip_members=%d", map->zip_members);
if (map->url && map->fi && sel && sel->order == 255) {
map_download_selection(map, mr, sel);
}
@@ -1580,7 +1580,7 @@ write_changes_do(gpointer key, gpointer value, gpointer user_data)
if (entry->flags) {
entry->flags=0;
fwrite(entry, sizeof(*entry)+(le32_to_cpu(entry->data[0])+1)*4, 1, out);
- dbg(lvl_debug,"yes\n");
+ dbg(lvl_debug,"yes");
}
}
@@ -1633,7 +1633,7 @@ map_rect_destroy_binfile(struct map_rect_priv *mr)
write_changes(mr->m);
while (pop_tile(mr));
#ifdef DEBUG_SIZE
- dbg(lvl_debug,"size=%d kb\n",mr->size/1024);
+ dbg(lvl_debug,"size=%d kb",mr->size/1024);
#endif
if (mr->tiles[0].fi && mr->tiles[0].start)
file_data_free(mr->tiles[0].fi, (unsigned char *)(mr->tiles[0].start));
@@ -1649,11 +1649,11 @@ setup_pos(struct map_rect_priv *mr)
struct tile *t=mr->t;
size=le32_to_cpu(t->pos[0]);
if (size > 1024*1024 || size < 0) {
- dbg(lvl_debug,"size=0x%x\n", size);
+ dbg(lvl_debug,"size=0x%x", size);
#if 0
fprintf(stderr,"offset=%d\n", (unsigned char *)(mr->pos)-mr->m->f->begin);
#endif
- dbg(lvl_debug,"size error\n");
+ dbg(lvl_debug,"size error");
}
t->pos_next=t->pos+size+1;
mr->item.type=le32_to_cpu(t->pos[1]);
@@ -1671,7 +1671,7 @@ selection_contains(struct map_selection *sel, struct coord_rect *r, struct range
while (sel) {
if (coord_rect_overlap(r, &sel->u.c_rect)) {
order=sel->order;
- dbg(lvl_debug,"min %d max %d order %d\n", mima->min, mima->max, order);
+ dbg(lvl_debug,"min %d max %d order %d", mima->min, mima->max, order);
if (!mima->min && !mima->max)
return 1;
if (order >= mima->min && order <= mima->max)
@@ -1703,13 +1703,13 @@ map_parse_country_binfile(struct map_rect_priv *mr)
struct attr af, al;
if(binfile_attr_get(mr->item.priv_data, attr_first_key, &af)) {
if(linguistics_compare(af.u.str,search->u.str,linguistics_cmp_partial)>0) {
- dbg(lvl_debug,"Skipping index item with first_key='%s'\n", af.u.str);
+ dbg(lvl_debug,"Skipping index item with first_key='%s'", af.u.str);
return;
}
}
if(binfile_attr_get(mr->item.priv_data, attr_last_key, &al)) {
if(linguistics_compare(al.u.str,search->u.str,linguistics_cmp_partial)<0) {
- dbg(lvl_debug,"Skipping index item with first_key='%s', last_key='%s'\n", af.u.str, al.u.str);
+ dbg(lvl_debug,"Skipping index item with first_key='%s', last_key='%s'", af.u.str, al.u.str);
return;
}
}
@@ -1744,7 +1744,7 @@ map_parse_submap(struct map_rect_priv *mr, int async)
return 0;
if (!binfile_attr_get(mr->item.priv_data, attr_zipfile_ref, &at))
return 0;
- dbg(lvl_debug,"pushing zipfile %ld from %d\n", at.u.num, mr->t->zipfile_num);
+ dbg(lvl_debug,"pushing zipfile %ld from %d", at.u.num, mr->t->zipfile_num);
return push_zipfile_tile(mr, at.u.num, 0, 0, async);
}
@@ -2110,12 +2110,12 @@ binmap_search_new(struct map_priv *map, struct item *item, struct attr *search,
if (town)
msp->mr = binmap_search_street_by_place(map, town, &c, &msp->ms, &msp->boundaries);
if (msp->boundaries)
- dbg(lvl_debug, "using map town boundaries\n");
+ dbg(lvl_debug, "using map town boundaries");
if (!msp->boundaries && town)
{
binmap_get_estimated_boundaries(town, &msp->boundaries);
if (msp->boundaries)
- dbg(lvl_debug, "using estimated boundaries\n");
+ dbg(lvl_debug, "using estimated boundaries");
}
map_rect_destroy_binfile(map_rec);
/* start searching in area around the street segment even if town boundaries are available */
@@ -2124,7 +2124,7 @@ binmap_search_new(struct map_priv *map, struct item *item, struct attr *search,
msp->rect_new=msp->ms.u.c_rect;
if(item_attr_get(msp->item, attr_street_name, &attr))
msp->parent_name=g_strdup(attr.u.str);
- dbg(lvl_debug,"pn=%s\n",msp->parent_name);
+ dbg(lvl_debug,"pn=%s",msp->parent_name);
}
}
if (idx != 3) {
@@ -2435,7 +2435,7 @@ binmap_search_get_item(struct map_search_priv *map_search)
map_search->ms.u.c_rect=map_search->rect_new;
map_rect_destroy_binfile(map_search->mr);
map_search->mr=map_rect_new_binfile(map_search->map, &map_search->ms);
- dbg(lvl_debug,"Extended house number search region to %d x %d, restarting...\n",map_search->ms.u.c_rect.rl.x - map_search->ms.u.c_rect.lu.x, map_search->ms.u.c_rect.lu.y-map_search->ms.u.c_rect.rl.y);
+ dbg(lvl_debug,"Extended house number search region to %d x %d, restarting...",map_search->ms.u.c_rect.rl.x - map_search->ms.u.c_rect.lu.x, map_search->ms.u.c_rect.lu.y-map_search->ms.u.c_rect.rl.y);
continue;
}
}
@@ -2567,7 +2567,7 @@ map_binfile_zip_setup(struct map_priv *m, char *filename, int mmap)
struct zip_cd *first_cd;
int i;
if (!(m->eoc=binfile_read_eoc(m->fi))) {
- dbg(lvl_error,"map file %s: unable to read eoc\n", filename);
+ dbg(lvl_error,"map file %s: unable to read eoc", filename);
return 0;
}
dbg_assert(m->eoc->zipedsk == m->eoc->zipecen);
@@ -2583,20 +2583,20 @@ map_binfile_zip_setup(struct map_priv *m, char *filename, int mmap)
m->fis[m->eoc->zipedsk-1]=m->fi;
g_free(tmpfilename);
}
- dbg(lvl_debug,"num_disk %d\n",m->eoc->zipedsk);
+ dbg(lvl_debug,"num_disk %d",m->eoc->zipedsk);
m->eoc64=binfile_read_eoc64(m->fi);
if (!binfile_get_index(m)) {
- dbg(lvl_error,"map file %s: no index found\n", filename);
+ dbg(lvl_error,"map file %s: no index found", filename);
return 0;
}
if (!(first_cd=binfile_read_cd(m, 0, 0))) {
- dbg(lvl_error,"map file %s: unable to get first cd\n", filename);
+ dbg(lvl_error,"map file %s: unable to get first cd", filename);
return 0;
}
m->cde_size=sizeof(struct zip_cd)+first_cd->zipcfnl+first_cd->zipcxtl;
m->zip_members=m->index_offset/m->cde_size+1;
- dbg(lvl_debug,"cde_size %d\n", m->cde_size);
- dbg(lvl_debug,"members %d\n",m->zip_members);
+ dbg(lvl_debug,"cde_size %d", m->cde_size);
+ dbg(lvl_debug,"members %d",m->zip_members);
file_data_free(m->fi, (unsigned char *)first_cd);
if (mmap)
file_mmap(m->fi);
@@ -2695,12 +2695,12 @@ map_binfile_open(struct map_priv *m)
struct attr readwrite={attr_readwrite, {(void *)1}};
struct attr *attrs[]={&readwrite, NULL};
- dbg(lvl_debug,"file_create %s\n", m->filename);
+ dbg(lvl_debug,"file_create %s", m->filename);
m->fi=file_create(m->filename, m->url?attrs:NULL);
if (! m->fi && m->url)
return 0;
if (! m->fi) {
- dbg(lvl_error,"Failed to load '%s'\n", m->filename);
+ dbg(lvl_error,"Failed to load '%s'", m->filename);
return 0;
}
if (m->check_version)
@@ -2714,13 +2714,13 @@ map_binfile_open(struct map_priv *m)
*magic = le32_to_cpu(*magic);
if (*magic == zip_lfh_sig || *magic == zip_split_sig || *magic == zip_cd_sig || *magic == zip64_eoc_sig) {
if (!map_binfile_zip_setup(m, m->filename, m->flags & 1)) {
- dbg(lvl_error,"invalid file format for '%s'\n", m->filename);
+ dbg(lvl_error,"invalid file format for '%s'", m->filename);
file_destroy(m->fi);
m->fi=NULL;
return 0;
}
} else if (*magic == zip_lfh_sig_rev || *magic == zip_split_sig_rev || *magic == zip_cd_sig_rev || *magic == zip64_eoc_sig_rev) {
- dbg(lvl_error,"endianness mismatch for '%s'\n", m->filename);
+ dbg(lvl_error,"endianness mismatch for '%s'", m->filename);
file_destroy(m->fi);
m->fi=NULL;
return 0;
@@ -2738,7 +2738,7 @@ map_binfile_open(struct map_priv *m)
if (binfile_attr_get(item->priv_data, attr_map_release, &attr))
m->map_release=g_strdup(attr.u.str);
if (m->url && binfile_attr_get(item->priv_data, attr_url, &attr)) {
- dbg(lvl_debug,"url config %s map %s\n",m->url,attr.u.str);
+ dbg(lvl_debug,"url config %s map %s",m->url,attr.u.str);
if (strcmp(m->url, attr.u.str))
m->update_available=1;
g_free(m->url);
@@ -2747,7 +2747,7 @@ map_binfile_open(struct map_priv *m)
}
map_rect_destroy_binfile(mr);
if (m->map_version >= 16) {
- dbg(lvl_error,"%s: This map is incompatible with your navit version. Please update navit. (map version %d)\n",
+ dbg(lvl_error,"%s: This map is incompatible with your navit version. Please update navit. (map version %d)",
m->filename, m->map_version);
return 0;
}
@@ -2811,7 +2811,7 @@ map_new_binfile(struct map_methods *meth, struct attr **attrs, struct callback_l
wexp=file_wordexp_new(data->u.str);
wexp_data=file_wordexp_get_array(wexp);
- dbg(lvl_debug,"map_new_binfile %s\n", data->u.str);
+ dbg(lvl_debug,"map_new_binfile %s", data->u.str);
*meth=map_methods_binfile;
m=g_new0(struct map_priv, 1);
@@ -2844,9 +2844,9 @@ map_new_binfile(struct map_methods *meth, struct attr **attrs, struct callback_l
void
plugin_init(void)
{
- dbg(lvl_debug,"binfile: plugin_init\n");
+ dbg(lvl_debug,"binfile: plugin_init");
if (sizeof(struct zip_cd) != 46) {
- dbg(lvl_error,"error: sizeof(struct zip_cd)=%zu\n",sizeof(struct zip_cd));
+ dbg(lvl_error,"error: sizeof(struct zip_cd)=%zu",sizeof(struct zip_cd));
}
plugin_register_category_map("binfile", map_new_binfile);
}