File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -462,16 +462,16 @@ bool_t xdr_set_gdl_pos(XDR *x, long int y){
462
462
// if (next!=(cur+cLength)) cerr<<"problem:"<<cur+cLength<<":"<<next<<"\n";
463
463
}
464
464
xdr_set_gdl_pos (xdrs, cur-12 ); // ptrs0
465
- // copy next (64 bit) as two 32 bits. Should be OK on 32 bit machines as next is u_int64.
466
- if (!BigEndian ()) { // first 32 bit is low, second high (XDRS is BigEndian)
465
+ // we write a sort of BigEndian format
467
466
U u;
468
467
u.soixantequatre =next;
469
- u_int32_t temp=u.trentedeux [0 ];
470
- u.trentedeux [0 ]=u.trentedeux [1 ];
471
- u.trentedeux [1 ]=temp;
472
- next=u.soixantequatre ;
473
- }
474
- xdr_uint64_t (xdrs, &next);
468
+ if (BigEndian ()) { // to be tested on BigEndian machines: may be some other logic at work?.
469
+ xdr_uint32_t (xdrs, &(u.trentedeux [1 ])); // least significative bits at end ( < 4 GB)
470
+ xdr_uint32_t (xdrs, &(u.trentedeux [0 ])); // for adresses > 4GB
471
+ } else {
472
+ xdr_uint32_t (xdrs, &(u.trentedeux [0 ])); // e.g. intel, little_endian 1st
473
+ xdr_uint32_t (xdrs, &(u.trentedeux [1 ])); // this would be for adresses > 4GB
474
+ }
475
475
xdr_set_gdl_pos (xdrs, next);
476
476
return next;
477
477
}
You can’t perform that action at this time.
0 commit comments