@@ -1269,34 +1269,36 @@ void put_blob( burp_fld* field, ISC_QUAD& blob_id)
12691269 put(tdgbl, (UCHAR) rec_blob);
12701270 put_int32(att_blob_field_number, field->fld_number);
12711271
1272- ULONG segments = 0, total_length = 0;
1272+ ULONG segments = 0;
1273+ FB_UINT64 total_length = 0;
12731274 USHORT max_segment = 0;
12741275 int blob_type = 0; // 0 - segmented, 1 - stream
12751276 const UCHAR* p = blob_info;
12761277
12771278 UCHAR item;
12781279 while ((item = *p++) != isc_info_end)
12791280 {
1280- const USHORT l = gds__vax_integer(p, 2);
1281+ const auto l = gds__vax_integer(p, 2);
12811282 p += 2;
1282- const ULONG n = gds__vax_integer (p, l);
1283+ const auto n = isc_portable_integer (p, l);
12831284 p += l;
1285+
12841286 switch (item)
12851287 {
12861288 case isc_info_blob_max_segment:
1287- max_segment = n;
1289+ max_segment = (USHORT) n;
12881290 break;
12891291
12901292 case isc_info_blob_type:
1291- blob_type = n;
1293+ blob_type = (int) n;
12921294 break;
12931295
12941296 case isc_info_blob_num_segments:
1295- segments = n;
1297+ segments = (ULONG) n;
12961298 break;
12971299
12981300 case isc_info_blob_total_length:
1299- total_length = n;
1301+ total_length = (FB_UINT64) n;
13001302 break;
13011303
13021304 default:
@@ -1312,12 +1314,7 @@ void put_blob( burp_fld* field, ISC_QUAD& blob_id)
13121314 // our own chunk size. Note, the number of segments returned by information
13131315 // call for stream blob is always unreliable, even for zero-length blobs
13141316 if (blob_type == 1)
1315- {
1316- if (total_length != 0)
1317- segments = (total_length + max_segment - 1) / max_segment;
1318- else
1319- segments = 0;
1320- }
1317+ segments = total_length ? (total_length + max_segment - 1) / max_segment : 0;
13211318
13221319 put_int32(att_blob_max_segment, max_segment);
13231320 put_int32(att_blob_number_segments, segments);
0 commit comments