Skip to content

Commit 0917a07

Browse files
committed
Postfix for CORE-6525 according to Adriano's suggestion
1 parent 60ec544 commit 0917a07

10 files changed

Lines changed: 138 additions & 141 deletions

File tree

src/burp/canonical.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ struct BurpXdr : public xdr_t
5959

6060
lstring* x_public;
6161
};
62-
typedef struct BurpXdr XDR;
63-
64-
static bool_t expand_buffer(XDR*);
65-
static int xdr_init(XDR*, lstring*, enum xdr_op);
66-
static bool_t xdr_slice(XDR*, lstring*, /*USHORT,*/ const UCHAR*);
62+
static bool_t expand_buffer(BurpXdr*);
63+
static int xdr_init(BurpXdr*, lstring*, enum xdr_op);
64+
static bool_t xdr_slice(BurpXdr*, lstring*, /*USHORT,*/ const UCHAR*);
6765

6866
const unsigned increment = 1024;
6967

@@ -83,8 +81,8 @@ ULONG CAN_encode_decode(burp_rel* relation, lstring* buffer, UCHAR* data, bool d
8381
const burp_fld* field;
8482
SSHORT n;
8583

86-
XDR xdr;
87-
XDR* xdrs = &xdr;
84+
BurpXdr xdr;
85+
BurpXdr* xdrs = &xdr;
8886

8987
xdr_init(xdrs, buffer, direction ? XDR_ENCODE : XDR_DECODE);
9088

@@ -274,8 +272,8 @@ ULONG CAN_slice(lstring* buffer, lstring* slice, bool direction, UCHAR* sdl)
274272
* encode and decode canonical backup.
275273
*
276274
**************************************/
277-
XDR xdr;
278-
XDR* xdrs = &xdr;
275+
BurpXdr xdr;
276+
BurpXdr* xdrs = &xdr;
279277

280278
xdr_init(xdrs, buffer, direction ? XDR_ENCODE : XDR_DECODE);
281279

@@ -354,7 +352,7 @@ bool_t BurpXdr::x_putbytes(const SCHAR* buff, unsigned bytecount)
354352
}
355353

356354

357-
static bool_t expand_buffer(XDR* xdrs)
355+
static bool_t expand_buffer(BurpXdr* xdrs)
358356
{
359357
/**************************************
360358
*
@@ -388,7 +386,7 @@ static bool_t expand_buffer(XDR* xdrs)
388386
}
389387

390388

391-
static int xdr_init(XDR* xdrs, lstring* buffer, enum xdr_op x_op)
389+
static int xdr_init(BurpXdr* xdrs, lstring* buffer, enum xdr_op x_op)
392390
{
393391
/**************************************
394392
*
@@ -408,7 +406,7 @@ static int xdr_init(XDR* xdrs, lstring* buffer, enum xdr_op x_op)
408406
}
409407

410408

411-
static bool_t xdr_slice(XDR* xdrs, lstring* slice, /*USHORT sdl_length,*/ const UCHAR* sdl)
409+
static bool_t xdr_slice(BurpXdr* xdrs, lstring* slice, /*USHORT sdl_length,*/ const UCHAR* sdl)
412410
{
413411
/**************************************
414412
*

src/common/xdr.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "../common/DecFloat.h"
3434
#include "../common/Int128.h"
3535

36-
typedef struct xdr_t XDR;
36+
typedef struct xdr_t xdr_t;
3737

3838
inline UCHAR* XDR_ALLOC(ULONG size)
3939
{
@@ -45,19 +45,19 @@ inline void XDR_FREEA(void* block)
4545
}
4646

4747
#ifdef DEBUG_XDR_MEMORY
48-
inline void DEBUG_XDR_ALLOC(XDR* xdrs, const void* xdrvar, const void* addr, ULONG len)
48+
inline void DEBUG_XDR_ALLOC(xdr_t* xdrs, const void* xdrvar, const void* addr, ULONG len)
4949
{
5050
xdr_debug_memory(xdrs, XDR_DECODE, xdrvar, addr, len)
5151
}
52-
inline void DEBUG_XDR_FREE(XDR* xdrs, const void* xdrvar, const void* addr, ULONG len)
52+
inline void DEBUG_XDR_FREE(xdr_t* xdrs, const void* xdrvar, const void* addr, ULONG len)
5353
{
5454
xdr_debug_memory (xdrs, XDR_FREE, xdrvar, addr, (ULONG) len);
5555
}
5656
#else
57-
inline void DEBUG_XDR_ALLOC(XDR*, const void*, const void*, ULONG)
57+
inline void DEBUG_XDR_ALLOC(xdr_t*, const void*, const void*, ULONG)
5858
{
5959
}
60-
inline void DEBUG_XDR_FREE(XDR*, const void*, const void*, ULONG)
60+
inline void DEBUG_XDR_FREE(xdr_t*, const void*, const void*, ULONG)
6161
{
6262
}
6363
#endif // DEBUG_XDR_MEMORY
@@ -73,7 +73,7 @@ const unsigned MAXSTRING_FOR_WRAPSTRING = 65535;
7373
#define GETBYTES xdrs->x_getbytes
7474
#define PUTBYTES xdrs->x_putbytes
7575

76-
inline bool_t GETLONG(XDR* xdrs, SLONG* lp)
76+
inline bool_t GETLONG(xdr_t* xdrs, SLONG* lp)
7777
{
7878
SLONG l;
7979

@@ -85,7 +85,7 @@ inline bool_t GETLONG(XDR* xdrs, SLONG* lp)
8585
return TRUE;
8686
}
8787

88-
inline bool_t PUTLONG(XDR* xdrs, const SLONG* lp)
88+
inline bool_t PUTLONG(xdr_t* xdrs, const SLONG* lp)
8989
{
9090
const SLONG l = xdrs->x_local ? *lp : htonl(*lp);
9191
return xdrs->x_putbytes(reinterpret_cast<const char*>(&l), 4);
@@ -94,7 +94,7 @@ inline bool_t PUTLONG(XDR* xdrs, const SLONG* lp)
9494
static SCHAR zeros[4] = { 0, 0, 0, 0 };
9595

9696

97-
bool_t xdr_hyper( XDR* xdrs, void* pi64)
97+
bool_t xdr_hyper( xdr_t* xdrs, void* pi64)
9898
{
9999
/**************************************
100100
*
@@ -155,7 +155,7 @@ bool_t xdr_hyper( XDR* xdrs, void* pi64)
155155
}
156156

157157

158-
bool_t xdr_datum( XDR* xdrs, const dsc* desc, UCHAR* buffer)
158+
bool_t xdr_datum( xdr_t* xdrs, const dsc* desc, UCHAR* buffer)
159159
{
160160
/**************************************
161161
*
@@ -335,7 +335,7 @@ bool_t xdr_datum( XDR* xdrs, const dsc* desc, UCHAR* buffer)
335335
}
336336

337337

338-
bool_t xdr_double(XDR* xdrs, double* ip)
338+
bool_t xdr_double(xdr_t* xdrs, double* ip)
339339
{
340340
/**************************************
341341
*
@@ -382,13 +382,13 @@ bool_t xdr_double(XDR* xdrs, double* ip)
382382
}
383383

384384

385-
bool_t xdr_dec64(XDR* xdrs, Firebird::Decimal64* ip)
385+
bool_t xdr_dec64(xdr_t* xdrs, Firebird::Decimal64* ip)
386386
{
387387
return xdr_hyper(xdrs, ip->getBytes());
388388
}
389389

390390

391-
bool_t xdr_dec128(XDR* xdrs, Firebird::Decimal128* ip)
391+
bool_t xdr_dec128(xdr_t* xdrs, Firebird::Decimal128* ip)
392392
{
393393
UCHAR* bytes = ip->getBytes();
394394

@@ -401,7 +401,7 @@ bool_t xdr_dec128(XDR* xdrs, Firebird::Decimal128* ip)
401401
}
402402

403403

404-
bool_t xdr_int128(XDR* xdrs, Firebird::Int128* ip)
404+
bool_t xdr_int128(xdr_t* xdrs, Firebird::Int128* ip)
405405
{
406406
UCHAR* bytes = ip->getBytes();
407407

@@ -414,7 +414,7 @@ bool_t xdr_int128(XDR* xdrs, Firebird::Int128* ip)
414414
}
415415

416416

417-
bool_t xdr_enum(XDR* xdrs, xdr_op* ip)
417+
bool_t xdr_enum(xdr_t* xdrs, xdr_op* ip)
418418
{
419419
/**************************************
420420
*
@@ -448,7 +448,7 @@ bool_t xdr_enum(XDR* xdrs, xdr_op* ip)
448448
}
449449

450450

451-
bool_t xdr_float(XDR* xdrs, float* ip)
451+
bool_t xdr_float(xdr_t* xdrs, float* ip)
452452
{
453453
/**************************************
454454
*
@@ -478,7 +478,7 @@ bool_t xdr_float(XDR* xdrs, float* ip)
478478
}
479479

480480

481-
bool_t xdr_int(XDR* xdrs, int* ip)
481+
bool_t xdr_int(xdr_t* xdrs, int* ip)
482482
{
483483
/**************************************
484484
*
@@ -512,7 +512,7 @@ bool_t xdr_int(XDR* xdrs, int* ip)
512512
}
513513

514514

515-
bool_t xdr_long(XDR* xdrs, SLONG* ip)
515+
bool_t xdr_long(xdr_t* xdrs, SLONG* ip)
516516
{
517517
/**************************************
518518
*
@@ -541,7 +541,7 @@ bool_t xdr_long(XDR* xdrs, SLONG* ip)
541541
}
542542

543543

544-
bool_t xdr_opaque(XDR* xdrs, SCHAR* p, unsigned len)
544+
bool_t xdr_opaque(xdr_t* xdrs, SCHAR* p, unsigned len)
545545
{
546546
/**************************************
547547
*
@@ -582,7 +582,7 @@ bool_t xdr_opaque(XDR* xdrs, SCHAR* p, unsigned len)
582582
}
583583

584584

585-
bool_t xdr_quad( XDR* xdrs, SQUAD* ip)
585+
bool_t xdr_quad( xdr_t* xdrs, SQUAD* ip)
586586
{
587587
/**************************************
588588
*
@@ -622,7 +622,7 @@ bool_t xdr_quad( XDR* xdrs, SQUAD* ip)
622622
}
623623

624624

625-
bool_t xdr_short(XDR* xdrs, SSHORT* ip)
625+
bool_t xdr_short(xdr_t* xdrs, SSHORT* ip)
626626
{
627627
/**************************************
628628
*
@@ -656,7 +656,7 @@ bool_t xdr_short(XDR* xdrs, SSHORT* ip)
656656
}
657657

658658

659-
bool_t xdr_string(XDR* xdrs, SCHAR** sp, unsigned maxlength)
659+
bool_t xdr_string(xdr_t* xdrs, SCHAR** sp, unsigned maxlength)
660660
{
661661
/**************************************
662662
*
@@ -719,7 +719,7 @@ bool_t xdr_string(XDR* xdrs, SCHAR** sp, unsigned maxlength)
719719
}
720720

721721

722-
bool_t xdr_u_int(XDR* xdrs, unsigned* ip)
722+
bool_t xdr_u_int(xdr_t* xdrs, unsigned* ip)
723723
{
724724
/**************************************
725725
*
@@ -754,7 +754,7 @@ bool_t xdr_u_int(XDR* xdrs, unsigned* ip)
754754
}
755755

756756

757-
bool_t xdr_u_long(XDR* xdrs, ULONG* ip)
757+
bool_t xdr_u_long(xdr_t* xdrs, ULONG* ip)
758758
{
759759
/**************************************
760760
*
@@ -785,7 +785,7 @@ bool_t xdr_u_long(XDR* xdrs, ULONG* ip)
785785
}
786786

787787

788-
bool_t xdr_u_short(XDR* xdrs, u_short* ip)
788+
bool_t xdr_u_short(xdr_t* xdrs, u_short* ip)
789789
{
790790
/**************************************
791791
*
@@ -819,7 +819,7 @@ bool_t xdr_u_short(XDR* xdrs, u_short* ip)
819819
}
820820

821821

822-
bool_t xdr_wrapstring(XDR* xdrs, SCHAR** strp)
822+
bool_t xdr_wrapstring(xdr_t* xdrs, SCHAR** strp)
823823
{
824824
/**************************************
825825
*
@@ -882,7 +882,7 @@ bool_t xdr_t::x_getbytes(SCHAR* buff, unsigned bytecount)
882882
}
883883

884884

885-
SLONG xdr_peek_long(const XDR* xdrs, const void* data, size_t size)
885+
SLONG xdr_peek_long(const xdr_t* xdrs, const void* data, size_t size)
886886
{
887887
/**************************************
888888
*

src/remote/inet.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ static void get_peer_info(rem_port*);
543543

544544
static void inet_gen_error(bool, rem_port*, const Arg::StatusVector& v);
545545
static void inet_error(bool, rem_port*, const TEXT*, ISC_STATUS, int);
546-
static bool inet_read(XDR*);
546+
static bool inet_read(RemoteXdr*);
547547
static rem_port* inet_try_connect( PACKET*,
548548
Rdb*,
549549
const PathName&,
@@ -552,7 +552,7 @@ static rem_port* inet_try_connect( PACKET*,
552552
RefPtr<const Config>*,
553553
const PathName*,
554554
int);
555-
static bool inet_write(XDR*);
555+
static bool inet_write(RemoteXdr*);
556556
static rem_port* listener_socket(rem_port* port, USHORT flag, const addrinfo* pai);
557557

558558
#ifdef DEBUG
@@ -571,15 +571,15 @@ static bool select_wait(rem_port*, Select*);
571571
static int send_full(rem_port*, PACKET *);
572572
static int send_partial(rem_port*, PACKET *);
573573

574-
static XDR* xdrinet_create(rem_port*, UCHAR *, USHORT, enum xdr_op);
574+
static RemoteXdr* xdrinet_create(rem_port*, UCHAR *, USHORT, enum xdr_op);
575575
static bool setNoNagleOption(rem_port*);
576576
static bool setFastLoopbackOption(rem_port*, SOCKET s = INVALID_SOCKET);
577577
static bool setKeepAlive(SOCKET);
578578
static FPTR_INT tryStopMainThread = 0;
579579

580580

581581

582-
struct InetXdr : public XDR
582+
struct InetXdr : public RemoteXdr
583583
{
584584
virtual bool_t x_getbytes(SCHAR *, unsigned); // get some bytes from "
585585
virtual bool_t x_putbytes(const SCHAR*, unsigned); // put some bytes to "
@@ -2469,7 +2469,7 @@ static int send_partial( rem_port* port, PACKET * packet)
24692469
}
24702470

24712471

2472-
XDR* xdrinet_create(rem_port* port, UCHAR* buffer, USHORT length, enum xdr_op x_op)
2472+
RemoteXdr* xdrinet_create(rem_port* port, UCHAR* buffer, USHORT length, enum xdr_op x_op)
24732473
{
24742474
/**************************************
24752475
*
@@ -2482,7 +2482,7 @@ XDR* xdrinet_create(rem_port* port, UCHAR* buffer, USHORT length, enum xdr_op x_
24822482
*
24832483
**************************************/
24842484

2485-
XDR* xdrs = FB_NEW InetXdr;
2485+
RemoteXdr* xdrs = FB_NEW InetXdr;
24862486

24872487
xdrs->x_public = port;
24882488
xdrs->create(reinterpret_cast<SCHAR*>(buffer), length, x_op);
@@ -2763,7 +2763,7 @@ bool_t InetXdr::x_putbytes(const SCHAR* buff, unsigned bytecount)
27632763
return TRUE;
27642764
}
27652765

2766-
static bool inet_read( XDR* xdrs)
2766+
static bool inet_read( RemoteXdr* xdrs)
27672767
{
27682768
/**************************************
27692769
*
@@ -2887,7 +2887,7 @@ static rem_port* inet_try_connect(PACKET* packet,
28872887
return port;
28882888
}
28892889

2890-
static bool inet_write(XDR* xdrs)
2890+
static bool inet_write(RemoteXdr* xdrs)
28912891
{
28922892
/**************************************
28932893
*

0 commit comments

Comments
 (0)