Skip to content

Commit e7d91cd

Browse files
committed
Prepare fixing MDEV-12149
compile errors on Windows with /Zc:strictStrings Introduce typedef PCSZ and replace PSZ by it where it matters modified: storage/connect/colblk.h modified: storage/connect/connect.cc modified: storage/connect/domdoc.cpp modified: storage/connect/domdoc.h modified: storage/connect/filamdbf.cpp modified: storage/connect/filamdbf.h modified: storage/connect/filamtxt.h modified: storage/connect/filamvct.cpp modified: storage/connect/filamvct.h modified: storage/connect/filamzip.cpp modified: storage/connect/filamzip.h modified: storage/connect/ha_connect.cc modified: storage/connect/ha_connect.h modified: storage/connect/jdbccat.h modified: storage/connect/jdbconn.cpp modified: storage/connect/jdbconn.h modified: storage/connect/odbccat.h modified: storage/connect/odbconn.cpp modified: storage/connect/odbconn.h modified: storage/connect/os.h modified: storage/connect/plgdbsem.h modified: storage/connect/plgxml.cpp modified: storage/connect/plgxml.h modified: storage/connect/reldef.cpp modified: storage/connect/reldef.h modified: storage/connect/tabdos.h modified: storage/connect/tabext.cpp modified: storage/connect/tabext.h modified: storage/connect/tabfix.h modified: storage/connect/tabfmt.cpp modified: storage/connect/tabjdbc.cpp modified: storage/connect/tabjdbc.h modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h modified: storage/connect/tabmgo.h modified: storage/connect/tabmul.h modified: storage/connect/tabmysql.cpp modified: storage/connect/tabmysql.h modified: storage/connect/tabodbc.cpp modified: storage/connect/tabodbc.h modified: storage/connect/tabsys.h modified: storage/connect/tabwmi.cpp modified: storage/connect/tabwmi.h modified: storage/connect/tabxml.cpp modified: storage/connect/tabxml.h modified: storage/connect/tabzip.h modified: storage/connect/xobject.cpp modified: storage/connect/xobject.h modified: storage/connect/xtable.h
1 parent d75d61c commit e7d91cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+345
-376
lines changed

storage/connect/colblk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class DllExport FIDBLK : public SPCBLK {
154154
virtual void ReadColumn(PGLOBAL g);
155155

156156
protected:
157-
PSZ Fn; // The current To_File of the table
157+
PCSZ Fn; // The current To_File of the table
158158
OPVAL Op; // The file part operator
159159
}; // end of class FIDBLK
160160

storage/connect/connect.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ bool CntInfo(PGLOBAL g, PTDB tp, PXF info)
168168

169169
// info->mean_rec_length= tdbp->GetLrecl();
170170
info->mean_rec_length= 0;
171-
info->data_file_name= (b) ? NULL : tdbp->GetFile(g);
171+
info->data_file_name= (b) ? NULL : (char*)tdbp->GetFile(g);
172172
return true;
173173
} else {
174174
info->data_file_length= 0;

storage/connect/domdoc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ DOMDOC::DOMDOC(char *nsl, char *nsdf, char *enc, PFBLOCK fp)
8989
/******************************************************************/
9090
/* Initialize XML parser and check library compatibility. */
9191
/******************************************************************/
92-
bool DOMDOC::Initialize(PGLOBAL g, char *entry, bool zipped)
92+
bool DOMDOC::Initialize(PGLOBAL g, PCSZ entry, bool zipped)
9393
{
9494
if (zipped && InitZip(g, entry))
9595
return true;

storage/connect/domdoc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class DOMDOC : public XMLDOCUMENT {
3737
virtual void SetNofree(bool b) {} // Only libxml2
3838

3939
// Methods
40-
virtual bool Initialize(PGLOBAL g, char *entry, bool zipped);
40+
virtual bool Initialize(PGLOBAL g, PCSZ entry, bool zipped);
4141
virtual bool ParseFile(PGLOBAL g, char *fn);
4242
virtual bool NewDoc(PGLOBAL g, char *ver);
4343
virtual void AddComment(PGLOBAL g, char *com);

storage/connect/filamdbf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ typedef struct _descriptor {
128128
/* Moves file pointer to byte 32; fills buffer at buf with */
129129
/* first 32 bytes of file. */
130130
/****************************************************************************/
131-
static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf)
131+
static int dbfhead(PGLOBAL g, FILE *file, PCSZ fn, DBFHEADER *buf)
132132
{
133133
char endmark[2];
134134
int dbc = 2, rc = RC_OK;
@@ -393,7 +393,7 @@ DBFBASE::DBFBASE(DBFBASE *txfp)
393393
/* and header length. Set Records, check that Reclen is equal to lrecl and */
394394
/* return the header length or 0 in case of error. */
395395
/****************************************************************************/
396-
int DBFBASE::ScanHeader(PGLOBAL g, PSZ fn, int lrecl, int *rln, char *defpath)
396+
int DBFBASE::ScanHeader(PGLOBAL g, PCSZ fn, int lrecl, int *rln, PSZ defpath)
397397
{
398398
int rc;
399399
char filename[_MAX_PATH];

storage/connect/filamdbf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class DllExport DBFBASE {
3131
DBFBASE(PDBF txfp);
3232

3333
// Implementation
34-
int ScanHeader(PGLOBAL g, PSZ fname, int lrecl, int *rlen, char *defpath);
34+
int ScanHeader(PGLOBAL g, PCSZ fname, int lrecl, int *rlen, PSZ defpath);
3535

3636
protected:
3737
// Default constructor, not to be used

storage/connect/filamtxt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class DllExport TXTFAM : public BLOCK {
8080
protected:
8181
// Members
8282
PTDBDOS Tdbp; // To table class
83-
PSZ To_File; // Points to table file name
83+
PCSZ To_File; // Points to table file name
8484
PFBLOCK To_Fb; // Pointer to file block
8585
PPARM To_Pos; // Pointer to position list
8686
PPARM To_Sos; // Pointer to start position list

storage/connect/filamvct.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ int VCTFAM::GetFileLength(PGLOBAL g)
143143
{
144144
if (Split) {
145145
// Get the total file length
146-
char filename[_MAX_PATH];
147-
char *savfile = To_File;
148-
int i, len = 0;
146+
char filename[_MAX_PATH];
147+
PCSZ savfile = To_File;
148+
int i, len = 0;
149149

150150
// Initialize the array of file structures
151151
if (!Colfn) {
@@ -313,8 +313,8 @@ int VCTFAM::Cardinality(PGLOBAL g)
313313
// and Last must be set from the file cardinality.
314314
// Only happens when called by sub classes.
315315
char filename[_MAX_PATH];
316-
PSZ savfn = To_File;
317-
int len, clen, card = -1;
316+
PCSZ savfn = To_File;
317+
int len, clen, card = -1;
318318
PCOLDEF cdp = Tdbp->GetDef()->GetCols();
319319

320320
if (!Colfn) {
@@ -368,7 +368,7 @@ int VCTFAM::GetRowID(void)
368368
/***********************************************************************/
369369
/* VCT Create an empty file for Vector formatted tables. */
370370
/***********************************************************************/
371-
bool VCTFAM::MakeEmptyFile(PGLOBAL g, char *fn)
371+
bool VCTFAM::MakeEmptyFile(PGLOBAL g, PCSZ fn)
372372
{
373373
// Vector formatted file: this will create an empty file of the
374374
// required length if it does not exists yet.
@@ -3319,7 +3319,7 @@ bool BGVFAM::SetBlockInfo(PGLOBAL g)
33193319
/***********************************************************************/
33203320
/* VEC Create an empty file for new Vector formatted tables. */
33213321
/***********************************************************************/
3322-
bool BGVFAM::MakeEmptyFile(PGLOBAL g, char *fn)
3322+
bool BGVFAM::MakeEmptyFile(PGLOBAL g, PCSZ fn)
33233323
{
33243324
// Vector formatted file this will create an empty file of the
33253325
// required length if it does not exists yet.

storage/connect/filamvct.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class DllExport VCTFAM : public FIXFAM {
6161
virtual bool WriteBlock(PGLOBAL g, PVCTCOL colp);
6262

6363
protected:
64-
virtual bool MakeEmptyFile(PGLOBAL g, char *fn);
64+
virtual bool MakeEmptyFile(PGLOBAL g, PCSZ fn);
6565
virtual bool OpenTempFile(PGLOBAL g);
6666
virtual bool MoveLines(PGLOBAL g) {return false;}
6767
virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL);
@@ -235,7 +235,7 @@ class BGVFAM : public VCTFAM {
235235
bool BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, bool b = false);
236236
bool BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req);
237237
bool BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req);
238-
virtual bool MakeEmptyFile(PGLOBAL g, char *fn);
238+
virtual bool MakeEmptyFile(PGLOBAL g, PCSZ fn);
239239
virtual bool OpenTempFile(PGLOBAL g);
240240
virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL);
241241
virtual bool CleanUnusedSpace(PGLOBAL g);

storage/connect/filamzip.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545

4646
#define WRITEBUFFERSIZE (16384)
4747

48-
bool ZipLoadFile(PGLOBAL g, char *zfn, char *fn, char *entry, bool append, bool mul);
48+
bool ZipLoadFile(PGLOBAL g, PCSZ zfn, PCSZ fn, PCSZ entry, bool append, bool mul);
4949

5050
/***********************************************************************/
5151
/* Compress a file in zip when creating a table. */
5252
/***********************************************************************/
53-
static bool ZipFile(PGLOBAL g, ZIPUTIL *zutp, char *fn, char *entry, char *buf)
53+
static bool ZipFile(PGLOBAL g, ZIPUTIL *zutp, PCSZ fn, PCSZ entry, char *buf)
5454
{
5555
int rc = RC_OK, size_read, size_buf = WRITEBUFFERSIZE;
5656
FILE *fin;
@@ -88,7 +88,7 @@ static bool ZipFile(PGLOBAL g, ZIPUTIL *zutp, char *fn, char *entry, char *buf)
8888
/***********************************************************************/
8989
/* Find and Compress several files in zip when creating a table. */
9090
/***********************************************************************/
91-
static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, char *pat, char *buf)
91+
static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf)
9292
{
9393
char filename[_MAX_PATH];
9494
int rc;
@@ -203,7 +203,7 @@ static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, char *pat, char *buf)
203203
/***********************************************************************/
204204
/* Load and Compress a file in zip when creating a table. */
205205
/***********************************************************************/
206-
bool ZipLoadFile(PGLOBAL g, char *zfn, char *fn, char *entry, bool append, bool mul)
206+
bool ZipLoadFile(PGLOBAL g, PCSZ zfn, PCSZ fn, PCSZ entry, bool append, bool mul)
207207
{
208208
char *buf;
209209
bool err;
@@ -228,7 +228,7 @@ bool ZipLoadFile(PGLOBAL g, char *zfn, char *fn, char *entry, bool append, bool
228228
/***********************************************************************/
229229
/* Constructors. */
230230
/***********************************************************************/
231-
ZIPUTIL::ZIPUTIL(PSZ tgt)
231+
ZIPUTIL::ZIPUTIL(PCSZ tgt)
232232
{
233233
zipfile = NULL;
234234
target = tgt;
@@ -269,7 +269,7 @@ void ZIPUTIL::getTime(tm_zip& tmZip)
269269
/* append: set true to append the zip file */
270270
/* return: true if open, false otherwise. */
271271
/***********************************************************************/
272-
bool ZIPUTIL::open(PGLOBAL g, char *filename, bool append)
272+
bool ZIPUTIL::open(PGLOBAL g, PCSZ filename, bool append)
273273
{
274274
if (!zipfile && !(zipfile = zipOpen64(filename,
275275
append ? APPEND_STATUS_ADDINZIP
@@ -295,7 +295,7 @@ void ZIPUTIL::close()
295295
/***********************************************************************/
296296
/* OpenTableFile: Open a DOS/UNIX table file from a ZIP file. */
297297
/***********************************************************************/
298-
bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, char *fn, bool append)
298+
bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, PCSZ fn, bool append)
299299
{
300300
/*********************************************************************/
301301
/* The file will be compressed. */
@@ -338,7 +338,7 @@ bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, char *fn, bool append)
338338
/***********************************************************************/
339339
/* Add target in zip file. */
340340
/***********************************************************************/
341-
bool ZIPUTIL::addEntry(PGLOBAL g, char *entry)
341+
bool ZIPUTIL::addEntry(PGLOBAL g, PCSZ entry)
342342
{
343343
//?? we dont need the stinking time
344344
zip_fileinfo zi = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
@@ -382,7 +382,7 @@ void ZIPUTIL::closeEntry()
382382
/***********************************************************************/
383383
/* Constructors. */
384384
/***********************************************************************/
385-
UNZIPUTL::UNZIPUTL(PSZ tgt, bool mul)
385+
UNZIPUTL::UNZIPUTL(PCSZ tgt, bool mul)
386386
{
387387
zipfile = NULL;
388388
target = tgt;
@@ -439,8 +439,8 @@ UNZIPUTL::UNZIPUTL(PZIPUTIL zutp)
439439
/* This code is the copyright property of Alessandro Felice Cantatore. */
440440
/* http://xoomer.virgilio.it/acantato/dev/wildcard/wildmatch.html */
441441
/***********************************************************************/
442-
bool UNZIPUTL::WildMatch(PSZ pat, PSZ str) {
443-
PSZ s, p;
442+
bool UNZIPUTL::WildMatch(PCSZ pat, PCSZ str) {
443+
PCSZ s, p;
444444
bool star = FALSE;
445445

446446
loopStart:
@@ -474,7 +474,7 @@ bool UNZIPUTL::WildMatch(PSZ pat, PSZ str) {
474474
/* param: filename path and the filename of the zip file to open. */
475475
/* return: true if open, false otherwise. */
476476
/***********************************************************************/
477-
bool UNZIPUTL::open(PGLOBAL g, char *filename)
477+
bool UNZIPUTL::open(PGLOBAL g, PCSZ filename)
478478
{
479479
if (!zipfile && !(zipfile = unzOpen64(filename)))
480480
sprintf(g->Message, "Zipfile open error on %s", filename);
@@ -564,7 +564,7 @@ int UNZIPUTL::nextEntry(PGLOBAL g)
564564
/***********************************************************************/
565565
/* OpenTableFile: Open a DOS/UNIX table file from a ZIP file. */
566566
/***********************************************************************/
567-
bool UNZIPUTL::OpenTable(PGLOBAL g, MODE mode, char *fn)
567+
bool UNZIPUTL::OpenTable(PGLOBAL g, MODE mode, PCSZ fn)
568568
{
569569
/*********************************************************************/
570570
/* The file will be decompressed into virtual memory. */
@@ -636,7 +636,7 @@ bool UNZIPUTL::OpenTable(PGLOBAL g, MODE mode, char *fn)
636636
/***********************************************************************/
637637
/* Insert only if the entry does not exist. */
638638
/***********************************************************************/
639-
bool UNZIPUTL::IsInsertOk(PGLOBAL g, char *fn)
639+
bool UNZIPUTL::IsInsertOk(PGLOBAL g, PCSZ fn)
640640
{
641641
bool ok = true, b = open(g, fn);
642642

0 commit comments

Comments
 (0)