You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -42,7 +42,17 @@ int current_ccode=-1; // cache for setup_country
42
42
43
43
#defineMAXGLOBALRESULTS 32 // The worst actually seems to be 14, which is at 52.050500, 113.468600
44
44
#defineWORSTCASE_MAPCODE_BYTES 16 // worst case is high-precision earth xxxxx.yyyy-zz, rounded upwords to multiple of 4 bytes (assuming latin-only results)
45
-
charglobal_buffer[MAXGLOBALRESULTS*2][WORSTCASE_MAPCODE_BYTES]; // cache for worst-case result
45
+
charglobal_storage[2048]; // cyclic cache for results
46
+
intstorage_ptr;
47
+
char*addstorage(constchar*str)
48
+
{
49
+
intlen=strlen(str)+1; // bytes needed;
50
+
storage_ptr &= (2048-1);
51
+
if (storage_ptr<0||storage_ptr+len>2048-2) storage_ptr=0;
52
+
strcpy(global_storage+storage_ptr,str);
53
+
storage_ptr+=len;
54
+
returnglobal_storage+storage_ptr-len;
55
+
}
46
56
char**global_results;
47
57
intnr_global_results;
48
58
@@ -1090,10 +1100,8 @@ void addresult(char *resultbuffer, char *result, long x,long y, int ccode)
1090
1100
if (result_override>=0) ccode=result_override; // 1.32 true recursive processing
1091
1101
#endif
1092
1102
if (*result&&global_results&&nr_global_results>=0&&nr_global_results+1<(2*MAXGLOBALRESULTS)) {
0 commit comments