ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Geo-LatLon2Place/LatLon2Place.xs
(Generate patch)

Comparing Geo-LatLon2Place/LatLon2Place.xs (file contents):
Revision 1.5 by root, Thu Mar 17 00:32:54 2022 UTC vs.
Revision 1.6 by root, Thu Mar 17 22:55:34 2022 UTC

81 { 81 {
82 int rx = x; 82 int rx = x;
83 rx += rx < 0 ? blat : 0; 83 rx += rx < 0 ? blat : 0;
84 rx -= rx >= blat ? blat : 0; 84 rx -= rx >= blat ? blat : 0;
85 85
86 unsigned char key[4] = { 86 unsigned char key[4];
87 key[0] = rx;
87 rx, rx >> 8, 88 key[1] = rx >> 8;
89 key[2] = y;
88 y, y >> 8, 90 key[3] = y >> 8;
89 };
90 91
91 //printf ("x,y %4d,%4d blat %d %d %g %02x%02x%02x%02x %d\n", rx, y, blat, (int)glat, TORAD(glat), key[0],key[1],key[2],key[3], sizeof(key)); 92 //printf ("x,y %4d,%4d blat %d %d %g %02x%02x%02x%02x %d\n", rx, y, blat, (int)glat, TORAD(glat), key[0],key[1],key[2],key[3], sizeof(key));
92 93
93 if (cdb_find (db, key, sizeof (key)) <= 0) 94 if (cdb_find (db, key, sizeof (key)) <= 0)
94 continue; 95 continue;
95 96
96 int len = cdb_datalen (db); 97 int len = cdb_datalen (db);
97 const U8 *ptr = cdb_get (db, len, cdb_datapos (db)); 98 const U8 *ptr = (const U8 *)cdb_get (db, len, cdb_datapos (db));
98 99
99 while (len > 0) 100 while (len > 0)
100 { 101 {
101 int datalen = ptr[5]; 102 int datalen = ptr[5];
102 103
123 } 124 }
124 125
125 if (!reslen) 126 if (!reslen)
126 XSRETURN_EMPTY; 127 XSRETURN_EMPTY;
127 128
128 RETVAL = newSVpvn (resptr + 6, reslen); 129 RETVAL = newSVpvn ((const char *)resptr + 6, reslen);
129} 130}
130 OUTPUT: RETVAL 131 OUTPUT: RETVAL
131 132
132############################################################################# 133#############################################################################
133 134
158 if (cdb_find (db, s, l) <= 0) 159 if (cdb_find (db, s, l) <= 0)
159 XSRETURN_UNDEF; 160 XSRETURN_UNDEF;
160 161
161 p = cdb_datapos (db); 162 p = cdb_datapos (db);
162 l = cdb_datalen (db); 163 l = cdb_datalen (db);
163 RETVAL = newSVpvn (cdb_get (db, l, p), l); 164 RETVAL = newSVpvn ((const char *)cdb_get (db, l, p), l);
164} 165}
165 OUTPUT: RETVAL 166 OUTPUT: RETVAL
166 167
167############################################################################# 168#############################################################################
168 169

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines