summaryrefslogtreecommitdiff
path: root/soltools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-11-10 09:16:52 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-11-10 11:50:44 +0100
commitbde11b3b1362a9451ef830bf14d0f8842818a922 (patch)
tree41b29b297c14c3a14ec65f89d69b2c41335718a1 /soltools
parentff9b9944401a594ec4a67bca953b312f3a54e3f8 (diff)
Executable_cpp: Drop unused -Xa "EBCDIC to ANSI conversion" option
...which nicely gets rid of a bunch of sprintf calls that otherwise could have caused -Werror,-Wdeprecated-declarations with macOS 13 SDK now). (That executable is only used during the build to process the .scp files.) Change-Id: I3b087b11f6d3d1bce9e595322a21e67986f5d1c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142537 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'soltools')
-rw-r--r--soltools/cpp/_tokens.c208
-rw-r--r--soltools/cpp/_unix.c5
-rw-r--r--soltools/cpp/cpp.h1
3 files changed, 1 insertions, 213 deletions
diff --git a/soltools/cpp/_tokens.c b/soltools/cpp/_tokens.c
index bf2803845c20..5cb403c270ed 100644
--- a/soltools/cpp/_tokens.c
+++ b/soltools/cpp/_tokens.c
@@ -32,171 +32,6 @@
static char wbuf[4 * OBS];
static char *wbp = wbuf;
-static int EBCDIC_ExternTokenDetected = 0;
-static int EBCDIC_StartTokenDetected = 0;
-
-static unsigned char toLatin1[256] =
-{
- 0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f, 0x97, 0x8d,
- 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,
- 0x9d, 0x0a, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8f, 0x1c, 0x1d,
- 0x1e, 0x1f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1b,
- 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07,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0x5c, 0xf7, 0x53, 0x54,
- 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2,
- 0xd3, 0xd5, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
- 0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f
-};
-
-#define MASK "\\x%x"
-
-static int
- memcpy_EBCDIC( char * pwbuf, uchar const *p, int len )
-{
- int currpos = 0;
- int processedchars = 0;
-
- if( len == 0 )
- return 0;
-
- if( len == 1 )
- {
- *pwbuf = *p;
- return 1;
- }
-
- /* copy spaces until " or ' */
- while( (p[ processedchars ] != '\"') && (p[ processedchars ] != '\'') )
- pwbuf[ currpos++ ] = p[ processedchars++ ];
-
- /* copy first " or ' */
- pwbuf[ currpos++ ] = p[ processedchars++ ];
-
- /* convert all characters until " or ' */
- while( processedchars < (len - 1) )
- {
- if( p[ processedchars ] == '\\' )
- {
- switch( p[ ++processedchars ] )
- {
- case 'n':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\n'] );
- processedchars++;
- break;
-
- case 't':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\t'] );
- processedchars++;
- break;
-
- case 'v':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\v'] );
- processedchars++;
- break;
-
- case 'b':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\b'] );
- processedchars++;
- break;
-
- case 'r':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\r'] );
- processedchars++;
- break;
-
- case 'f':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\f'] );
- processedchars++;
- break;
-
- case 'a':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\a'] );
- processedchars++;
- break;
-
- case '\\':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\\'] );
- processedchars++;
- break;
-
- case '?':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\?'] );
- processedchars++;
- break;
-
- case '\'':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\''] );
- processedchars++;
- break;
-
- case '"':
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1['\"'] );
- processedchars++;
- break;
-
- /* octal coded character? -> copy */
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- {
- int startpos = currpos;
-
- pwbuf[ currpos++ ] = '\\';
-
- while( p[ processedchars ] >= '0' && p[ processedchars ] <= '7' && (currpos < startpos + 4) )
- pwbuf[ currpos++ ] = (unsigned char)p[ processedchars++ ];
- break;
- }
-
- /* hex coded character? -> copy */
- case 'x':
- case 'X':
- {
- int startpos = currpos;
-
- pwbuf[ currpos++ ] = '\\';
- pwbuf[ currpos++ ] = 'x';
- processedchars++;
-
- while( isxdigit( p[ processedchars ] ) && (currpos < startpos + 4) )
- pwbuf[ currpos++ ] = (unsigned char)p[ processedchars++ ];
- break;
- }
-
- }
- }
- else
- currpos += sprintf( &pwbuf[ currpos ], MASK, toLatin1[p[ processedchars++ ]] );
-
- }
-
- /* copy last " or ' */
- pwbuf[ currpos++ ] = p[ processedchars ];
-
- return currpos;
-}
void
maketokenrow(int size, Tokenrow * trp)
@@ -443,48 +278,7 @@ void
}
}
- /* EBCDIC to ANSI conversion requested? */
- if( Aflag )
- {
- /* keyword __ToLatin1__ found? -> do conversion! */
- if( EBCDIC_StartTokenDetected )
- {
- /* previous token was 'extern'? -> don't convert current token! */
- if( EBCDIC_ExternTokenDetected )
- {
- EBCDIC_ExternTokenDetected = 0;
- memcpy(wbp, p, len);
- }
- else
- {
- /* current token is keyword 'extern'? -> don't convert following token! */
- if( (tp->wslen == 0) && (strncmp( (char*)p, "extern", len ) == 0) )
- {
- EBCDIC_ExternTokenDetected = 1;
- memcpy(wbp, p, len);
- }
- else
- {
- /* token is string or char? -> process EBCDIC to ANSI conversion */
- if ((tp->type == STRING) || (tp->type == CCON))
- len = memcpy_EBCDIC(wbp, p, len);
- else
- memcpy(wbp, p, len);
- }
- }
- }
- else
- /* keyword __ToLatin1__ found? -> don't copy keyword and start conversion */
- if( (tp->type == NAME) && (strncmp( (char*)p, "__ToLatin1__", len) == 0) )
- {
- EBCDIC_StartTokenDetected = 1;
- len = 0;
- }
- else
- memcpy(wbp, p, len);
- }
- else
- memcpy(wbp, p, len);
+ memcpy(wbp, p, len);
wbp += len;
}
diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
index 1135bb08ea40..7c411befebea 100644
--- a/soltools/cpp/_unix.c
+++ b/soltools/cpp/_unix.c
@@ -40,7 +40,6 @@
int Pflag = 0; /* print no line information */
int Iflag = 0; /* print includes */
int Mflag = 0; /* print macro expansion */
-int Aflag = 0; /* translate character sets */
int Xflag = 0; /* print pragma for include/import */
int Vflag = 0; /* verbose flag */
int Cflag = 0; /* do not remove any comments */
@@ -140,10 +139,6 @@ void
break;
switch (c)
{
- case 'a':
- Aflag++;
- break;
-
case 'i':
Xflag++;
break;
diff --git a/soltools/cpp/cpp.h b/soltools/cpp/cpp.h
index ab5a89fc99eb..000327561d52 100644
--- a/soltools/cpp/cpp.h
+++ b/soltools/cpp/cpp.h
@@ -235,7 +235,6 @@ extern int ifsatisfied[NIF];
extern int Mflag;
extern int Iflag;
extern int Pflag;
-extern int Aflag;
extern int Lflag;
extern int Xflag;
extern int Vflag;