@@ -155,7 +155,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
155155 pg_log (ctx , PG_FATAL , "%d: pg_resetxlog problem\n" , __LINE__ );
156156
157157 p ++ ; /* removing ':' char */
158- cluster -> controldata .ctrl_ver = ( uint32 ) atol (p );
158+ cluster -> controldata .ctrl_ver = str2uint (p );
159159 }
160160 else if ((p = strstr (bufin , "Catalog version number:" )) != NULL )
161161 {
@@ -165,7 +165,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
165165 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
166166
167167 p ++ ; /* removing ':' char */
168- cluster -> controldata .cat_ver = ( uint32 ) atol (p );
168+ cluster -> controldata .cat_ver = str2uint (p );
169169 }
170170 else if ((p = strstr (bufin , "First log file ID after reset:" )) != NULL )
171171 {
@@ -175,7 +175,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
175175 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
176176
177177 p ++ ; /* removing ':' char */
178- cluster -> controldata .logid = ( uint32 ) atol (p );
178+ cluster -> controldata .logid = str2uint (p );
179179 got_log_id = true;
180180 }
181181 else if ((p = strstr (bufin , "First log file segment after reset:" )) != NULL )
@@ -186,7 +186,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
186186 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
187187
188188 p ++ ; /* removing ':' char */
189- cluster -> controldata .nxtlogseg = ( uint32 ) atol (p );
189+ cluster -> controldata .nxtlogseg = str2uint (p );
190190 got_log_seg = true;
191191 }
192192 else if ((p = strstr (bufin , "Latest checkpoint's TimeLineID:" )) != NULL )
@@ -197,7 +197,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
197197 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
198198
199199 p ++ ; /* removing ':' char */
200- cluster -> controldata .chkpnt_tli = ( uint32 ) atol (p );
200+ cluster -> controldata .chkpnt_tli = str2uint (p );
201201 got_tli = true;
202202 }
203203 else if ((p = strstr (bufin , "Latest checkpoint's NextXID:" )) != NULL )
@@ -211,7 +211,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
211211 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
212212
213213 op ++ ; /* removing ':' char */
214- cluster -> controldata .chkpnt_nxtxid = ( uint32 ) atol (op );
214+ cluster -> controldata .chkpnt_nxtxid = str2uint (op );
215215 got_xid = true;
216216 }
217217 else if ((p = strstr (bufin , "Latest checkpoint's NextOID:" )) != NULL )
@@ -222,7 +222,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
222222 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
223223
224224 p ++ ; /* removing ':' char */
225- cluster -> controldata .chkpnt_nxtoid = ( uint32 ) atol (p );
225+ cluster -> controldata .chkpnt_nxtoid = str2uint (p );
226226 got_oid = true;
227227 }
228228 else if ((p = strstr (bufin , "Maximum data alignment:" )) != NULL )
@@ -233,7 +233,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
233233 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
234234
235235 p ++ ; /* removing ':' char */
236- cluster -> controldata .align = ( uint32 ) atol (p );
236+ cluster -> controldata .align = str2uint (p );
237237 got_align = true;
238238 }
239239 else if ((p = strstr (bufin , "Database block size:" )) != NULL )
@@ -244,7 +244,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
244244 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
245245
246246 p ++ ; /* removing ':' char */
247- cluster -> controldata .blocksz = ( uint32 ) atol (p );
247+ cluster -> controldata .blocksz = str2uint (p );
248248 got_blocksz = true;
249249 }
250250 else if ((p = strstr (bufin , "Blocks per segment of large relation:" )) != NULL )
@@ -255,7 +255,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
255255 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
256256
257257 p ++ ; /* removing ':' char */
258- cluster -> controldata .largesz = ( uint32 ) atol (p );
258+ cluster -> controldata .largesz = str2uint (p );
259259 got_largesz = true;
260260 }
261261 else if ((p = strstr (bufin , "WAL block size:" )) != NULL )
@@ -266,7 +266,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
266266 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
267267
268268 p ++ ; /* removing ':' char */
269- cluster -> controldata .walsz = ( uint32 ) atol (p );
269+ cluster -> controldata .walsz = str2uint (p );
270270 got_walsz = true;
271271 }
272272 else if ((p = strstr (bufin , "Bytes per WAL segment:" )) != NULL )
@@ -277,7 +277,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
277277 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
278278
279279 p ++ ; /* removing ':' char */
280- cluster -> controldata .walseg = ( uint32 ) atol (p );
280+ cluster -> controldata .walseg = str2uint (p );
281281 got_walseg = true;
282282 }
283283 else if ((p = strstr (bufin , "Maximum length of identifiers:" )) != NULL )
@@ -288,7 +288,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
288288 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
289289
290290 p ++ ; /* removing ':' char */
291- cluster -> controldata .ident = ( uint32 ) atol (p );
291+ cluster -> controldata .ident = str2uint (p );
292292 got_ident = true;
293293 }
294294 else if ((p = strstr (bufin , "Maximum columns in an index:" )) != NULL )
@@ -299,7 +299,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
299299 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
300300
301301 p ++ ; /* removing ':' char */
302- cluster -> controldata .index = ( uint32 ) atol (p );
302+ cluster -> controldata .index = str2uint (p );
303303 got_index = true;
304304 }
305305 else if ((p = strstr (bufin , "Maximum size of a TOAST chunk:" )) != NULL )
@@ -310,7 +310,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
310310 pg_log (ctx , PG_FATAL , "%d: controldata retrieval problem\n" , __LINE__ );
311311
312312 p ++ ; /* removing ':' char */
313- cluster -> controldata .toast = ( uint32 ) atol (p );
313+ cluster -> controldata .toast = str2uint (p );
314314 got_toast = true;
315315 }
316316 else if ((p = strstr (bufin , "Date/time type storage:" )) != NULL )
0 commit comments