[Libreoffice-commits] core.git: soltools/cpp soltools/mkdepend

2022-11-10 Thread Stephan Bergmann (via logerrit)
 soltools/cpp/_macro.c   |4 
 soltools/mkdepend/include.c |4 
 soltools/mkdepend/pr.c  |5 +
 3 files changed, 13 insertions(+)

New commits:
commit 707449adc90c80e68176c8df873803ff2f6f70f2
Author: Stephan Bergmann 
AuthorDate: Thu Nov 10 09:21:21 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Nov 10 14:50:53 2022 +0100

-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): soltools

These occurrences of sprintf in C code don't normally trigger the 
deprecation
warning at least with recent macOS, because macOS by default now enables
_FORTIFY_SOURCE (see the code setting it in

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/_types.h
when originally unset), which for C code hides the declaration of sprintf 
(along
with its deprecation annotation) in

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/stdio.h
with a macro (expanding to __builtin___sprintf_chk) in

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/secure/_stdio.h.
But they started to trigger when I did an experimental -fsanitize=address 
build,
because


"Disable source fortification on Darwin with AddressSanitizer" predefines
-D_FORTIFY_SOURCE=0 in that case.

While there might be ways to clean this code up to use something better 
than the
deprecated sprintf, don't bother too much with this 3rd-party, 
build-time--only
code and just silence any potential deprecation warnings.

Change-Id: I9f223a0ad50b2729b5d9af2db588fe9f82d0b07f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142534
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/soltools/cpp/_macro.c b/soltools/cpp/_macro.c
index ef41b992edae..fbf496b8f781 100644
--- a/soltools/cpp/_macro.c
+++ b/soltools/cpp/_macro.c
@@ -27,6 +27,8 @@
 #endif
 #include 
 
+#include 
+
 #include "cpp.h"
 
 #define NCONCAT 16384
@@ -143,7 +145,9 @@ void
 {
 if (cp != location)
 *cp++ = ' ';
+SAL_WNODEPRECATED_DECLARATIONS_PUSH /* sprintf (macOS 13 SDK) */
 sprintf((char *)cp, "%s:%d", s->filename, s->line);
+SAL_WNODEPRECATED_DECLARATIONS_POP
 cp += strlen((char *)cp);
 }
 
diff --git a/soltools/mkdepend/include.c b/soltools/mkdepend/include.c
index d05a8fd75a7f..7f7955a68984 100644
--- a/soltools/mkdepend/include.c
+++ b/soltools/mkdepend/include.c
@@ -32,6 +32,8 @@ in this Software without prior written authorization from the 
X Consortium.
 #include 
 #include 
 
+#include 
+
 static void remove_dotdot( char * );
 static int isdot( char const * );
 static int isdotdot( char const * );
@@ -128,7 +130,9 @@ struct inclist *inc_path(char *file, char *include, boolean 
dot, struct Includes
  */
 if (!found)
 for (pp = includedirs; *pp; pp++) {
+SAL_WNODEPRECATED_DECLARATIONS_PUSH /* sprintf (macOS 13 SDK) */
 sprintf(path, "%s/%s", *pp, include);
+SAL_WNODEPRECATED_DECLARATIONS_POP
 remove_dotdot(path);
 if ((exists_path(incCollection, path)) && stat(path, ) == 0 && 
!(st.st_mode & S_IFDIR)) {
 ip = newinclude(path, include);
diff --git a/soltools/mkdepend/pr.c b/soltools/mkdepend/pr.c
index 7911502ed813..4d30dd3839bd 100644
--- a/soltools/mkdepend/pr.c
+++ b/soltools/mkdepend/pr.c
@@ -29,6 +29,9 @@ in this Software without prior written authorization from the 
X Consortium.
 
 #include "def.h"
 #include 
+
+#include 
+
 static size_t pr( struct inclist *ip, char *file,char *base);
 
 extern int  width;
@@ -117,8 +120,10 @@ size_t pr(struct inclist *ip, char *file, char *base)
 len = (int)strlen(ip->i_file)+4;
 if (file != lastfile) {
 lastfile = file;
+SAL_WNODEPRECATED_DECLARATIONS_PUSH /* sprintf (macOS 13 SDK) */
 sprintf(buf, "\n%s%s%s: \\\n %s", objprefix, base, objsuffix,
 ip->i_file);
+SAL_WNODEPRECATED_DECLARATIONS_POP
 len = (int)strlen(buf);
 }
 else {


[Libreoffice-commits] core.git: soltools/cpp

2022-11-10 Thread Stephan Bergmann (via logerrit)
 soltools/cpp/_tokens.c |  208 -
 soltools/cpp/_unix.c   |5 -
 soltools/cpp/cpp.h |1 
 3 files changed, 1 insertion(+), 213 deletions(-)

New commits:
commit bde11b3b1362a9451ef830bf14d0f8842818a922
Author: Stephan Bergmann 
AuthorDate: Thu Nov 10 09:16:52 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Nov 10 11:50:44 2022 +0100

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 

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, 0x90, 0x91,
-0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9a, 0x9b,
-0x14, 0x15, 0x9e, 0x1a, 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1,
-0xe3, 0xe5, 0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c,
-0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, 0xec, 0xdf,
-0x21, 0x24, 0x2a, 0x29, 0x3b, 0x5e, 0x2d, 0x2f, 0xc2, 0xc4,
-0xc0, 0xc1, 0xc3, 0xc5, 0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f,
-0x3e, 0x3f, 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf,
-0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22,
-0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
-0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, 0xb0, 0x6a, 0x6b, 0x6c,
-0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8,
-0xc6, 0xa4, 0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
-0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0x5b, 0xde, 0xae, 0xac, 0xa3,
-0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, 0xbd, 0xbe, 0xdd, 0xa8,
-0xaf, 0x5d, 0xb4, 0xd7, 0x7b, 0x41, 0x42, 0x43, 0x44, 0x45,
-0x46, 0x47, 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5,
-0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52,
-0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff, 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( [ currpos ], MASK, 
toLatin1['\n'] );
-processedchars++;
-break;
-
-case 't':
-currpos += sprintf( [ currpos ], MASK, 
toLatin1['\t'] );
-processedchars++;
-break;
-
-case 'v':
-currpos += sprintf( [ currpos ], MASK, 
toLatin1['\v'] );
-processedchars++;
-break;
-
-case 'b':
-currpos += sprintf( [ currpos ], MASK, 
toLatin1['\b'] );
-processedchars++;
-break;
-
-case 'r':
-currpos += sprintf( [ currpos ], MASK, 
toLatin1['\r'] );
-processedchars++;
-break;
-
-case 'f':
-currpos += sprintf( [ currpos ], MASK, 
toLatin1['\f'] );
-processedchars++;
-break;
-
-case 'a':
-currpos += sprintf( [ currpos ], MASK, 
toLatin1['\a'] );
-processedchars++;
-break;
-
-case '\\':
-currpos += sprintf( [ currpos ], MASK, 
toLatin1['\\'] 

[Libreoffice-commits] core.git: soltools/cpp

2020-04-16 Thread Caolán McNamara (via logerrit)
 soltools/cpp/_eval.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit a435887eaf747d9b17b3620884ac2ec06d63ac00
Author: Caolán McNamara 
AuthorDate: Thu Apr 16 20:38:12 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 16 22:24:48 2020 +0200

cid#1462267 Infinite loop

since...

commit a2362e0ff5a7cec16e888502a3c16fe2fa7ba0fe
Date:   Wed Apr 15 19:32:09 2020 +0200

loplugin:buriedassign in sfx2..sot

Change-Id: Iabbef1b027cb6bd77b387142df926c5b37858517
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92392
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/soltools/cpp/_eval.c b/soltools/cpp/_eval.c
index e8b679ea93e1..dba04abf4649 100644
--- a/soltools/cpp/_eval.c
+++ b/soltools/cpp/_eval.c
@@ -726,9 +726,11 @@ struct value
 if (*p == 'x')
 {
 p += 1;
-i = digit(*p);
-while (i >= 0 && i <= 15)
+while (1)
 {
+i = digit(*p);
+if (i < 0 || i > 16)
+break;
 p += 1;
 n <<= 4;
 n += i;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp

2019-10-21 Thread Stephan Bergmann (via logerrit)
 soltools/cpp/_tokens.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a0f8df427e9363fc787f189d6a3145e01a8e698c
Author: Stephan Bergmann 
AuthorDate: Sun Oct 20 23:15:40 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Oct 21 09:27:41 2019 +0200

Avoid -fsanitize=nullptr-with-offset

(new with recent Clang 10 trunk) during e.g. InstallModule_scp2/ooo:

> [SPP] scp2/source/ooo/common_brand
> soltools/cpp/_tokens.c:336:13: runtime error: applying zero offset to 
null pointer
>  #0 in copytokenrow at soltools/cpp/_tokens.c:336:13
>  #1 in expand at soltools/cpp/_macro.c:325:5
>  #2 in expandrow at soltools/cpp/_macro.c:292:13
>  #3 in process at soltools/cpp/_cpp.c:106:17
>  #4 in main at soltools/cpp/_cpp.c:60:5

Change-Id: Icbe1c105fbd0ff634f3e2966c27af1b89398be13
Reviewed-on: https://gerrit.libreoffice.org/81187
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/soltools/cpp/_tokens.c b/soltools/cpp/_tokens.c
index c095ca6c6b9d..ff01657204db 100644
--- a/soltools/cpp/_tokens.c
+++ b/soltools/cpp/_tokens.c
@@ -333,7 +333,8 @@ Tokenrow *
 
 maketokenrow(len, dtr);
 movetokenrow(dtr, str);
-dtr->lp += len;
+if (len != 0)
+dtr->lp += len;
 return dtr;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: soltools/cpp

2019-07-24 Thread Caolán McNamara (via logerrit)
 soltools/cpp/_cpp.c   |1 +
 soltools/cpp/_lex.c   |1 +
 soltools/cpp/_macro.c |7 +++
 soltools/cpp/_unix.c  |1 +
 4 files changed, 10 insertions(+)

New commits:
commit 421c7d874d62f3d0f696df540744845753902583
Author: Caolán McNamara 
AuthorDate: Wed Jul 24 10:25:09 2019 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jul 24 17:20:04 2019 +0200

cid#1448523 silence bogus Out-of-bounds read

Change-Id: I0911133287ace66454e741f7ea994f191d06931c
Reviewed-on: https://gerrit.libreoffice.org/76232
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/soltools/cpp/_cpp.c b/soltools/cpp/_cpp.c
index 0a7ce78d1749..003611c3f53b 100644
--- a/soltools/cpp/_cpp.c
+++ b/soltools/cpp/_cpp.c
@@ -74,6 +74,7 @@ void
 {
 trp->tp = trp->lp = trp->bp;
 outptr = outbuf;
+// coverity[overrun-buffer-arg: FALSE] - a multiple of trp->max is 
allocated, not trp->max itself
 anymacros |= gettokens(trp, 1);
 trp->tp = trp->bp;
 }
diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c
index 0efd303d242e..dfd8605a3950 100644
--- a/soltools/cpp/_lex.c
+++ b/soltools/cpp/_lex.c
@@ -364,6 +364,7 @@ continue2:
 {
 trp->lp = tp;
 tp = growtokenrow(trp);
+// coverity[overrun-local : FALSE] - a multiple of trp->max is 
allocated, not trp->max itself
 maxp = >bp[trp->max];
 }
 tp->type = UNCLASS;
diff --git a/soltools/cpp/_macro.c b/soltools/cpp/_macro.c
index 8a89e9379d36..eaafb86034ef 100644
--- a/soltools/cpp/_macro.c
+++ b/soltools/cpp/_macro.c
@@ -287,7 +287,10 @@ void
 if (np->flag & ISMAC)
 builtin(trp, np->val);
 else
+{
+// coverity[overrun-buffer-arg: FALSE] - a multiple of trp->max is 
allocated, not trp->max itself
 expand(trp, np, );
+}
 tp = trp->tp;
 }   // end for
 if (flag)
@@ -430,7 +433,10 @@ int
 while (parens > 0)
 {
 if (trp->tp >= trp->lp)
+{
+// coverity[overrun-buffer-arg: FALSE] - a multiple of trp->max is 
allocated, not trp->max itself
 gettokens(trp, 0);
+}
 if (needspace)
 {
 needspace = 0;
@@ -602,6 +608,7 @@ void
 tt[len] = '\0';
 setsource("<##>", -1, -1, tt, 0);
 maketokenrow(3, );
+// coverity[overrun-buffer-arg: FALSE] - a multiple of 
trp->max is allocated, not trp->max itself
 gettokens(, 1);
 unsetsource();
 if (ntr.bp->type == UNCLASS)
diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
index 2ee9215524a2..ac4b7624a00a 100644
--- a/soltools/cpp/_unix.c
+++ b/soltools/cpp/_unix.c
@@ -87,6 +87,7 @@ void
 case 'A':
 setsource("", -1, -1, optarg, 0);
 maketokenrow(3, );
+// coverity[overrun-buffer-arg: FALSE] - a multiple of 
trp->max is allocated, not trp->max itself
 gettokens(, 1);
 doadefine(, c);
 dofree(tr.bp);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: soltools/cpp

2019-03-15 Thread Libreoffice Gerrit user
 soltools/cpp/_getopt.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 659fe6f310772b822adf3a2d32bcddbfc3bb1277
Author: Stephan Bergmann 
AuthorDate: Fri Mar 15 08:37:40 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Mar 15 16:54:31 2019 +0100

loplugin:typedefparam

Change-Id: Id694376160986b74ef2bf6cacdd96c13669d5c32
Reviewed-on: https://gerrit.libreoffice.org/69291
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/soltools/cpp/_getopt.h b/soltools/cpp/_getopt.h
index cb0a5008f410..c894c2c9153f 100644
--- a/soltools/cpp/_getopt.h
+++ b/soltools/cpp/_getopt.h
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_SOLTOOLS_CPP__GETOPT_H
 #define INCLUDED_SOLTOOLS_CPP__GETOPT_H
 
-int stgetopt(int, char *const *, const char *);
+int stgetopt(int, char *const [], const char *);
 extern char *optarg;
 extern int optind;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: soltools/cpp soltools/mkdepend

2019-02-05 Thread Libreoffice Gerrit user
 soltools/cpp/_include.c |   28 ++--
 soltools/mkdepend/pr.c  |   26 +-
 2 files changed, 27 insertions(+), 27 deletions(-)

New commits:
commit dcc06dee258e04eff0140901d6e2e783ec3e2dd8
Author: Noel Grandin 
AuthorDate: Tue Feb 5 14:05:15 2019 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 6 07:07:57 2019 +0100

loplugin:flatten in soltools

Change-Id: I3df754c58c90978ef5fccc90518ad1af92516a9e
Reviewed-on: https://gerrit.libreoffice.org/67404
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/soltools/cpp/_include.c b/soltools/cpp/_include.c
index 1404aa4887a5..c9f20537f5eb 100644
--- a/soltools/cpp/_include.c
+++ b/soltools/cpp/_include.c
@@ -227,24 +227,24 @@ void
 static Tokenrow tr = {, ,  + 1, 1};
 uchar *p;
 
-if (Cplusplus)
-{
-ta.t = p = (uchar *) outptr;
+if (!Cplusplus)
+return;
 
-if (! end)
-strcpy((char *) p, "extern \"C\" {");
-else
-strcpy((char *) p, "}");
+ta.t = p = (uchar *) outptr;
 
-p += strlen((char *) p);
+if (! end)
+strcpy((char *) p, "extern \"C\" {");
+else
+strcpy((char *) p, "}");
 
-*p++ = '\n';
+p += strlen((char *) p);
 
-ta.len = (char *) p - outptr;
-outptr = (char *) p;
-tr.tp = tr.bp;
-puttokens();
-}
+*p++ = '\n';
+
+ta.len = (char *) p - outptr;
+outptr = (char *) p;
+tr.tp = tr.bp;
+puttokens();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/soltools/mkdepend/pr.c b/soltools/mkdepend/pr.c
index 391e39dfcd20..731b2f16626e 100644
--- a/soltools/mkdepend/pr.c
+++ b/soltools/mkdepend/pr.c
@@ -56,19 +56,19 @@ void add_include(struct filepointer *filep, struct inclist 
*file, struct inclist
 show_where_not = FALSE;
 }
 
-if (newfile) {
-
-/* Only add new dependency files if they don't have "/usr/include" in 
them. */
-if (!(newfile->i_file && strstr(newfile->i_file, "/usr/"))) {
-included_by(file, newfile);
-}
-
-if (!newfile->i_searched) {
-newfile->i_searched = TRUE;
-content = getfile(newfile->i_file);
-find_includes(content, newfile, file_red, 0, failOK, 
incCollection, symbols);
-freefile(content);
-}
+if (!newfile)
+return;
+
+/* Only add new dependency files if they don't have "/usr/include" in 
them. */
+if (!(newfile->i_file && strstr(newfile->i_file, "/usr/"))) {
+included_by(file, newfile);
+}
+
+if (!newfile->i_searched) {
+newfile->i_searched = TRUE;
+content = getfile(newfile->i_file);
+find_includes(content, newfile, file_red, 0, failOK, incCollection, 
symbols);
+freefile(content);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp

2018-11-21 Thread Libreoffice Gerrit user
 soltools/cpp/cpp.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3c51ab7573d4c6e585a7142e73b8d84d5a238b79
Author: Noel Grandin 
AuthorDate: Wed Nov 21 15:30:11 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 22 08:47:33 2018 +0100

remove unused toktype::IDENT

Change-Id: I4222902d9ef93e92dfbcbd089d6aaf7d724fa0de
Reviewed-on: https://gerrit.libreoffice.org/63750
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/soltools/cpp/cpp.h b/soltools/cpp/cpp.h
index 64c37ad07899..ab5a89fc99eb 100644
--- a/soltools/cpp/cpp.h
+++ b/soltools/cpp/cpp.h
@@ -46,7 +46,7 @@ enum toktype
 COLON, ASGN, COMMA, SHARP, SEMIC, CBRA, CKET,
 ASPLUS, ASMINUS, ASSTAR, ASSLASH, ASPCT, ASCIRC, ASLSH,
 ASRSH, ASOR, ASAND, ELLIPS,
-DSHARP1, NAME1, NAME2, DEFINED, UMINUS, ARCHITECTURE, IDENT,
+DSHARP1, NAME1, NAME2, DEFINED, UMINUS, ARCHITECTURE,
 COMMENT
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp

2018-10-04 Thread Libreoffice Gerrit user
 soltools/cpp/_lex.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 22c1d6972b4dbf2a3394a28cacfb27cf5bdbb659
Author: Stephan Bergmann 
AuthorDate: Thu Oct 4 10:27:54 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 4 14:23:16 2018 +0200

Avoid -Werror=stringop-truncation

... "‘strncpy’ output truncated before terminating nul copying as many bytes
from a string as its length", as reported at


"LO build fails -Werror=stringop-truncation in _lex.c".  Not adding the
terminating NUL appears to be intentional here, as the s->inp buffer is
terminated (through s->inl) with EOB bytes after the if/else blocks.

Change-Id: I5a8559e620b7e34ee27cbcd0f836432deb8cba90
Reviewed-on: https://gerrit.libreoffice.org/61355
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c
index 3fa180b040a4..70c808b87187 100644
--- a/soltools/cpp/_lex.c
+++ b/soltools/cpp/_lex.c
@@ -668,7 +668,7 @@ Source *
 len = strlen(str);
 s->inb = domalloc(len + 4);
 s->inp = s->inb;
-strncpy((char *) s->inp, str, len);
+memcpy((char *) s->inp, str, len);
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp

2018-09-18 Thread Libreoffice Gerrit user
 soltools/cpp/_getopt.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 67b153e0defb2f3e098a47bfcb2e8432b887a248
Author: Stephan Bergmann 
AuthorDate: Tue Sep 18 10:38:42 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 18 16:32:34 2018 +0200

loplugin:external (in non-Linux code)

Change-Id: I8cd9d278cfa9da9ceaab364a549d0e2c92d4be09
Reviewed-on: https://gerrit.libreoffice.org/60664
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/soltools/cpp/_getopt.c b/soltools/cpp/_getopt.c
index a5cd4389558b..8f9181ccad52 100644
--- a/soltools/cpp/_getopt.c
+++ b/soltools/cpp/_getopt.c
@@ -27,7 +27,7 @@
 
 static int opterr = 1;
 int optind = 1;
-int optopt;
+static int optopt;
 char *optarg;
 
 int
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp

2018-09-16 Thread Libreoffice Gerrit user
 soltools/cpp/_cpp.c|4 ++--
 soltools/cpp/_eval.c   |8 
 soltools/cpp/_lex.c|4 +---
 soltools/cpp/_tokens.c |2 +-
 4 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 41493823f98a1751df943b07da8b887f29052ffb
Author: Stephan Bergmann 
AuthorDate: Sat Sep 15 19:08:24 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Sun Sep 16 20:53:28 2018 +0200

loplugin:external in Executable_cpp

...showing that tottok and tokkind are actually unused

Change-Id: Ic70f4f1fd7b585b00e98b538d116599e395a43b9
Reviewed-on: https://gerrit.libreoffice.org/60536
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/soltools/cpp/_cpp.c b/soltools/cpp/_cpp.c
index 5d71e8af58c0..56c309321157 100644
--- a/soltools/cpp/_cpp.c
+++ b/soltools/cpp/_cpp.c
@@ -25,10 +25,10 @@
 #include "cpp.h"
 
 #define OUTS16384
-char outbuf[OUTS];
+static char outbuf[OUTS];
 char *outptr = outbuf;
 Source *cursource;
-int nerrs;
+static int nerrs;
 struct token nltoken = {NL, 0, 1, (uchar *) "\n", 0};
 char *curtime;
 int incdepth;
diff --git a/soltools/cpp/_eval.c b/soltools/cpp/_eval.c
index 498fda740e89..48526b76e94b 100644
--- a/soltools/cpp/_eval.c
+++ b/soltools/cpp/_eval.c
@@ -238,10 +238,10 @@ static struct pri priority[] =
 },  /* ARCHITECTURE */
 };
 
-int evalop(struct pri);
-struct value tokval(Token *);
-struct value vals[NSTAK], *vp;
-enum toktype ops[NSTAK], *op;
+static int evalop(struct pri);
+static struct value tokval(Token *);
+static struct value vals[NSTAK], *vp;
+static enum toktype ops[NSTAK], *op;
 
 /*
  * Evaluate an #if #elif #ifdef #ifndef line.  trp->tp points to the keyword.
diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c
index 6a5becb32679..3fa180b040a4 100644
--- a/soltools/cpp/_lex.c
+++ b/soltools/cpp/_lex.c
@@ -64,8 +64,6 @@ enum state
 S_STNL, S_COMNL, S_EOFCOM, S_COMMENT, S_EOB, S_WS, S_NAME
 };
 
-int tottok;
-int tokkind[256];
 struct fsm
 {
 int state;  /* if in this state */
@@ -256,7 +254,7 @@ static /*const*/ struct fsm fsm[] = {
 
 /* first index is char, second is state */
 /* increase #states to power of 2 to encourage use of shift */
-short bigfsm[256][MAXSTATE];
+static short bigfsm[256][MAXSTATE];
 
 void
 expandlex(void)
diff --git a/soltools/cpp/_tokens.c b/soltools/cpp/_tokens.c
index c099f7ae1f89..6842de38301f 100644
--- a/soltools/cpp/_tokens.c
+++ b/soltools/cpp/_tokens.c
@@ -66,7 +66,7 @@ static unsigned char toLatin1[256] =
 
 #define MASK"\\x%x"
 
-int
+static int
 memcpy_EBCDIC( char * pwbuf, uchar const *p, int len )
 {
 int currpos = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp

2017-08-21 Thread Stephan Bergmann
 soltools/cpp/cpp.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dac11d8d504351644cf914b0f3f3689148b36e1b
Author: Stephan Bergmann 
Date:   Mon Aug 21 13:52:47 2017 +0200

Make cpp cope with long source lines

under --with-lang=ALL it had started to crash during e.g.

> 
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}".../instdir/program:.../instdir/program"
 .../workdir/LinkTarget/Executable/cpp -+ -P -DWITH_POSTGRESQL_SDBC 
-DWITH_FIREBIRD_SDBC -DWITHOUT_EXTENSION_MEDIAWIKI 
-DWITHOUT_SCRIPTING_BEANSHELL -DWITHOUT_SCRIPTING_JAVASCRIPT 
-DWITH_HELPPACK_INTEGRATION -DWITH_EXTENSION_INTEGRATION 
-DENABLE_EXTENSION_UPDATE -DX86_64 -DLINUX -D_PTHREADS -DUNIX -DUNX 
-DCOMID=gcc3 -D_gcc3 -DWITH_LPSOLVER -I.../scp2/inc -I.../workdir 
-I.../config_host -I.../workdir/CustomTarget/scp2/macros 
-I.../workdir/ScpTemplateTarget/scp2/source/templates 
.../scp2/source/calc/file_calc.scp > 
.../workdir/ScpPreprocessTarget/scp2/source/calc/file_calc.pre

because of

> Syscall param read(buf) points to unaddressable byte(s)
>at 0x4F31A80: __read_nocancel (syscall-template.S:84)
>by 0x404F98: fillbuf (_lex.c:631)
>by 0x404CCF: gettokens (_lex.c:479)
>by 0x400F0A: process (_cpp.c:77)
>by 0x400E80: main (_cpp.c:60)
>  Address 0x5278494 is 0 bytes after a block of size 32,772 alloc'd
>at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
>by 0x402034: domalloc (_cpp.c:321)
>by 0x40554F: setsource (_lex.c:679)
>by 0x403E38: doinclude (_include.c:130)
>by 0x401F9D: control (_cpp.c:297)
>by 0x401002: process (_cpp.c:101)
>by 0x400E80: main (_cpp.c:60)

There appears to be no other check that fillbuf doesn't overflow the 
Source's
input buffer, other than gettokens checking that the buffer isn't more than
three quarters full ("if (ip >= s->inb + (3 * INS / 4)) ...").  That smells 
like
cpp assumes input lines to be shorter than some maximum number of characters
(like the C99 standard setting a minimum limit of "4095 characters in 
logical
source lines"), and

> #define README_TXT_ALL_LANG(key, name, ext) \
>   key (af) = READMETXTFILENAME(name,_af,ext); \
>   Name (am) = CONFIGLANGFILENAME(name,am,ext); \
>   Name (ar) = CONFIGLANGFILENAME(name,ar,ext); \
[...]
>   Name (zh-CN) = CONFIGLANGFILENAME(name,zh-CN,ext); \
>   Name (zh-TW) = CONFIGLANGFILENAME(name,zh-TW,ext); \
>   key (zu) = READMETXTFILENAME(name,_zu,ext)

in workdir/CustomTarget/scp2/macros/langmacros.inc (which appears to be the
culprit here) exceeding that limit under --with-lang=ALL.

So just bump the input buffer size.

Change-Id: I5d863050fb772dc7e691a604009ff8702dc718e3

diff --git a/soltools/cpp/cpp.h b/soltools/cpp/cpp.h
index e09ea7db86f2..36b867679d15 100644
--- a/soltools/cpp/cpp.h
+++ b/soltools/cpp/cpp.h
@@ -20,7 +20,7 @@
 #include 
 #include 
 
-#define INS 32768   /* input buffer */
+#define INS 327680  /* input buffer */
 #define OBS 8092/* output buffer*/
 #define NARG32  /* Max number arguments to a macro  */
 #define NINCLUDE48  /* Max number of include directories (-I)   */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp sw/source toolkit/source tools/source

2017-08-10 Thread Christian Barth
 soltools/cpp/_macro.c|3 ++-
 sw/source/filter/html/htmlatr.cxx|2 +-
 sw/source/filter/ww8/wrtw8sty.cxx|4 ++--
 sw/source/filter/ww8/ww8scan.cxx |2 +-
 sw/source/ui/dbui/dbinsdlg.cxx   |2 +-
 toolkit/source/helper/unopropertyarrayhelper.cxx |6 +++---
 tools/source/stream/stream.cxx   |2 +-
 7 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 88b0711aa5cda440805fa49f16f7c83ea0b2e292
Author: Christian Barth 
Date:   Thu Aug 10 20:25:35 2017 +0200

tdf#39468: Translate some german comments

Change-Id: Ie9062738de26b44394d4c91b31fab99a813f
Signed-off-by: Christian Barth 
Reviewed-on: https://gerrit.libreoffice.org/40994
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/soltools/cpp/_macro.c b/soltools/cpp/_macro.c
index a5e5b931d431..e8b87d002f4c 100644
--- a/soltools/cpp/_macro.c
+++ b/soltools/cpp/_macro.c
@@ -587,8 +587,9 @@ void
 ntp->len + ntp->wslen);
 len += ntp->len + ntp->wslen;
 }
-else// Leerzeichen um ## herum entfernen:
+else
 {
+// remove spaces around ##
 strncpy((char *) tt + len, (char *) ntp->t, ntp->len);
 len += ntp->len;
 }
diff --git a/sw/source/filter/html/htmlatr.cxx 
b/sw/source/filter/html/htmlatr.cxx
index 2d99f4dabcd3..a7390832ad27 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -2820,7 +2820,7 @@ static Writer& OutHTML_SwUnderline( Writer& rWrt, const 
SfxPoolItem& rHt )
 }
 else if( rHTMLWrt.m_bCfgOutStyles && rHTMLWrt.m_bTextAttr )
 {
-// vielleicht als CSS1-Attribut ?
+// maybe as CSS1 attribute?
 OutCSS1_HintSpanTag( rWrt, rHt );
 }
 
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index a6abde487871..cae1fb75bc5f 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1001,7 +1001,7 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport 
)
 pFormat = pSectNd->GetSection().GetFormat();
 }
 
-// Hole evtl. Pagedesc des 1. Nodes
+// Try to get page descriptor of the first node
 if ( pSet &&
  SfxItemState::SET == pSet->GetItemState( RES_PAGEDESC, true,  ) &&
  static_cast(pI)->GetPageDesc() )
@@ -1901,7 +1901,7 @@ void MSWordExportBase::WriteHeaderFooterText( const 
SwFormat& rFormat, bool bHea
 {
 // there is no Header/Footer, but a CR is still necessary
 OSL_ENSURE( pSttIdx, "Header/Footer text is not really present" );
-AttrOutput().EmptyParagraph(); // CR ans Ende ( sonst mault WW )
+AttrOutput().EmptyParagraph();
 }
 }
 
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index cacbf5b54cd5..5d82f5d61706 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -6721,7 +6721,7 @@ struct WW8_FFN_Ver6
 sal_Char szFfn[maxStrSize]; // 0x6 bzw. 0x40 ab Ver8 zero terminated 
string that
 // records name of font.
 // Maximal size of szFfn is 65 characters.
-// Vorsicht: Dieses Array kann auch kleiner sein!!!
+// Attention: This array can also be smaller!!!
 // Possibly followed by a second sz which records the
 // name of an alternate font to use if the first named
 // font does not exist on this system.
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 272d2d6fb3b0..d1ebf8a4360f 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1001,7 +1001,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const 
Sequence& rSelection,
 }
 
 do{ // middle checked loop!!
-if( bAsTable )  // Daten als Tabelle einfuegen
+if( bAsTable )  // fill in data as table
 {
 rSh.DoUndo( false );
 
diff --git a/toolkit/source/helper/unopropertyarrayhelper.cxx 
b/toolkit/source/helper/unopropertyarrayhelper.cxx
index d78544c9fb4a..fcae24bc831e 100644
--- a/toolkit/source/helper/unopropertyarrayhelper.cxx
+++ b/toolkit/source/helper/unopropertyarrayhelper.cxx
@@ -66,7 +66,7 @@ sal_Bool UnoPropertyArrayHelper::fillPropertyMembersByHandle( 
OUString * pPropNa
 
 css::uno::Sequence< css::beans::Property > 
UnoPropertyArrayHelper::getProperties()
 {
-// Sortiert nach Namen...
+// Sort by names ...
 
 std::map aSortedPropsIds;
 for( 

[Libreoffice-commits] core.git: soltools/cpp soltools/mkdepend

2017-03-22 Thread Stephan Bergmann
 soltools/cpp/_unix.c |2 +-
 soltools/mkdepend/cppsetup.c |2 +-
 soltools/mkdepend/ifparser.c |   14 +++---
 soltools/mkdepend/parse.c|4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 97a6bf07012f5a55d16f28c3bb3d039a09f8d700
Author: Stephan Bergmann 
Date:   Wed Mar 22 21:58:37 2017 +0100

Fix passing plain char into ctype.h is* functions

Change-Id: I4de56462e1fe5bba3035fec691feda91be88b434

diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
index 1010e3084eb6..274ee5acaf3a 100644
--- a/soltools/cpp/_unix.c
+++ b/soltools/cpp/_unix.c
@@ -149,7 +149,7 @@ void
 case 'w':
 dp = [n + 1];
 n += (int)strlen(dp);
-while (isspace(*dp)) dp++;
+while (isspace((unsigned char)*dp)) dp++;
 
 for (i = NINCLUDE - 1; i >= 0; i--)
 {
diff --git a/soltools/mkdepend/cppsetup.c b/soltools/mkdepend/cppsetup.c
index 708e75dc099e..750142af9ddf 100644
--- a/soltools/mkdepend/cppsetup.c
+++ b/soltools/mkdepend/cppsetup.c
@@ -174,7 +174,7 @@ my_eval_defined (IfParser *ip, const char *var, size_t len)
 return 0;
 }
 
-#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
+#define isvarfirstletter(ccc) (isalpha((unsigned char)(ccc)) || (ccc) == '_')
 
 static int
 my_eval_variable (IfParser *ip, const char *var, size_t len)
diff --git a/soltools/mkdepend/ifparser.c b/soltools/mkdepend/ifparser.c
index 274a72a7fce8..8777e795f18e 100644
--- a/soltools/mkdepend/ifparser.c
+++ b/soltools/mkdepend/ifparser.c
@@ -69,8 +69,8 @@
 
 #define DO(val) if (!(val)) return NULL
 #define CALLFUNC(ggg,fff) (*((ggg)->funcs.fff))
-#define SKIPSPACE(ccc) while (isspace(*ccc)) ccc++
-#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
+#define SKIPSPACE(ccc) while (isspace((unsigned char)*ccc)) ccc++
+#define isvarfirstletter(ccc) (isalpha((unsigned char)(ccc)) || (ccc) == '_')
 
 
 static const char *
@@ -83,7 +83,7 @@ parse_variable (IfParser *g, const char *cp, const char 
**varp)
 
 *varp = cp;
 /* EMPTY */
-for (cp++; isalnum(*cp) || *cp == '_'; cp++) ;
+for (cp++; isalnum((unsigned char)*cp) || *cp == '_'; cp++) ;
 return cp;
 }
 
@@ -93,7 +93,7 @@ parse_number (IfParser *g, const char *cp, int *valp)
 {
 SKIPSPACE (cp);
 
-if (!isdigit(*cp))
+if (!isdigit((unsigned char)*cp))
 return CALLFUNC(g, handle_error) (g, cp, "number");
 
 #ifdef _WIN32
@@ -104,7 +104,7 @@ parse_number (IfParser *g, const char *cp, int *valp)
 #else
 *valp = atoi (cp);
 /* EMPTY */
-for (cp++; isdigit(*cp); cp++) ;
+for (cp++; isdigit((unsigned char)*cp); cp++) ;
 #endif
 return cp;
 }
@@ -155,7 +155,7 @@ parse_value (IfParser *g, const char *cp, int *valp)
 return cp + 1;
 
   case 'd':
-if (strncmp (cp, "defined", 7) == 0 && !isalnum(cp[7])) {
+if (strncmp (cp, "defined", 7) == 0 && !isalnum((unsigned char)cp[7])) 
{
 int paren = 0;
 size_t len;
 
@@ -176,7 +176,7 @@ parse_value (IfParser *g, const char *cp, int *valp)
 /* fall out */
 }
 
-if (isdigit(*cp)) {
+if (isdigit((unsigned char)*cp)) {
   DO (cp = parse_number (g, cp, valp));
 } else if (!isvarfirstletter(*cp))
   return CALLFUNC(g, handle_error) (g, cp, "variable or number");
diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c
index 250a6a66a702..41ae113e9ff0 100644
--- a/soltools/mkdepend/parse.c
+++ b/soltools/mkdepend/parse.c
@@ -293,7 +293,7 @@ int deftype (char *line, struct filepointer *filep, struct 
inclist *file_red, st
 /*
  * separate the name of a single symbol.
  */
-while (isalnum(*p) || *p == '_')
+while (isalnum((unsigned char)*p) || *p == '_')
 *line++ = *p++;
 *line = '\0';
 break;
@@ -385,7 +385,7 @@ void define( char *def, struct symhash **symbols )
 
 /* Separate symbol name and its value */
 val = def;
-while (isalnum(*val) || *val == '_')
+while (isalnum((unsigned char)*val) || *val == '_')
 val++;
 if (*val)
 *val++ = '\0';
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp

2017-01-26 Thread Stephan Bergmann
 soltools/cpp/_eval.c |2 +-
 soltools/cpp/_lex.c  |2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 23bf4227231eb081f906382ca05e7c2bea5612ec
Author: Stephan Bergmann 
Date:   Thu Jan 26 14:55:14 2017 +0100

-Werror=implicit-fallthrough= (GCC 7)

Change-Id: I2e9ab956fc1e59d09b7409333f18230e34b6a9b7

diff --git a/soltools/cpp/_eval.c b/soltools/cpp/_eval.c
index 84d8a79b..e1eceb2 100644
--- a/soltools/cpp/_eval.c
+++ b/soltools/cpp/_eval.c
@@ -319,7 +319,7 @@ long
 }
 continue;
 }
-/* flow through */
+/* fall through */
 
 /* plain binary */
 case EQ:
diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c
index a8f874d..de18fd5 100644
--- a/soltools/cpp/_lex.c
+++ b/soltools/cpp/_lex.c
@@ -492,6 +492,7 @@ continue2:
 
 case S_STNL:
 error(ERROR, "Unterminated string or char const");
+/* fall through */
 case S_NL:
 tp->t = ip;
 tp->type = NL;
@@ -516,6 +517,7 @@ continue2:
 case S_EOFCOM:
 error(WARNING, "EOF inside comment");
 --ip;
+/* fall through */
 case S_COMMENT:
 if (!Cflag)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp soltools/mkdepend

2017-01-09 Thread Stephan Bergmann
 soltools/cpp/_eval.c|3 ++-
 soltools/cpp/_getopt.c  |2 +-
 soltools/cpp/_lex.c |2 +-
 soltools/cpp/_nlist.c   |3 ++-
 soltools/cpp/_tokens.c  |2 +-
 soltools/mkdepend/def.h |   16 
 soltools/mkdepend/include.c |5 +
 soltools/mkdepend/main.c|   10 +-
 soltools/mkdepend/parse.c   |3 +--
 soltools/mkdepend/pr.c  |8 +---
 10 files changed, 31 insertions(+), 23 deletions(-)

New commits:
commit 62ee434e336dac7523cace3b3acea6894ef3a509
Author: Stephan Bergmann 
Date:   Mon Jan 9 20:19:22 2017 +0100

loplugin:externvar

Change-Id: I304144c0ae6b51656ad326a77e9402cc34d5aa18

diff --git a/soltools/cpp/_eval.c b/soltools/cpp/_eval.c
index f10fa79..84d8a79b 100644
--- a/soltools/cpp/_eval.c
+++ b/soltools/cpp/_eval.c
@@ -46,8 +46,9 @@ struct pri
 char pri;
 char arity;
 char ctype;
-}   priority[] =
+};
 
+static struct pri priority[] =
 {
 {
 0, 0, 0
diff --git a/soltools/cpp/_getopt.c b/soltools/cpp/_getopt.c
index 24a6cfb..4e609ba 100644
--- a/soltools/cpp/_getopt.c
+++ b/soltools/cpp/_getopt.c
@@ -25,7 +25,7 @@
 #define EPR fprintf(stderr,
 #define ERR(str, chr)   if(opterr) { EPR "%s%c\n", str, chr); }
 
-int opterr = 1;
+static int opterr = 1;
 int optind = 1;
 int optopt;
 char *optarg;
diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c
index fde7605..a8f874d 100644
--- a/soltools/cpp/_lex.c
+++ b/soltools/cpp/_lex.c
@@ -73,7 +73,7 @@ struct fsm
 int nextstate;  /* enter this state if +ve */
 };
 
- /*const*/ struct fsm fsm[] = {
+static /*const*/ struct fsm fsm[] = {
 /* start state */
  {START, {C_XX}, ACT(UNCLASS, S_SELF)},
  {START, {' ', '\t', '\v'}, WS1},
diff --git a/soltools/cpp/_nlist.c b/soltools/cpp/_nlist.c
index 83516f4..3bd1a65 100644
--- a/soltools/cpp/_nlist.c
+++ b/soltools/cpp/_nlist.c
@@ -42,8 +42,9 @@ struct kwtab
 char *kw;
 int val;
 int flag;
-}   kwtab[] =
+};
 
+static struct kwtab kwtab[] =
 {
 {"if", KIF, ISKW},
 {"ifdef", KIFDEF, ISKW},
diff --git a/soltools/cpp/_tokens.c b/soltools/cpp/_tokens.c
index c764886..bac4216 100644
--- a/soltools/cpp/_tokens.c
+++ b/soltools/cpp/_tokens.c
@@ -34,7 +34,7 @@ static char *wbp = wbuf;
 static int EBCDIC_ExternTokenDetected = 0;
 static int EBCDIC_StartTokenDetected = 0;
 
-unsigned char toLatin1[256] =
+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,
diff --git a/soltools/mkdepend/def.h b/soltools/mkdepend/def.h
index 74445a2..5e96a2b 100644
--- a/soltools/mkdepend/def.h
+++ b/soltools/mkdepend/def.h
@@ -191,4 +191,20 @@ void warning1(char *, ...);
 void convert_slashes(char *);
 char *append_slash(char *);
 
+extern char * directives[];
+
+extern struct inclist * inclistp;
+
+extern char * objprefix;
+
+extern char * objsuffix;
+
+extern boolean printed;
+
+extern boolean verbose;
+
+extern boolean show_where_not;
+
+extern boolean warn_multiple;
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/soltools/mkdepend/include.c b/soltools/mkdepend/include.c
index 6712b1a..e83ac0f 100644
--- a/soltools/mkdepend/include.c
+++ b/soltools/mkdepend/include.c
@@ -38,12 +38,9 @@ int issymbolic(char * dir, char * component);
 int exists_path(struct IncludesCollection*, char*);
 
 
-extern struct inclist inclist[ MAXFILES ],
-  *inclistp;
+extern struct inclist inclist[ MAXFILES ];
 extern char *includedirs[ ];
 extern char *notdotdot[ ];
-extern boolean show_where_not;
-extern boolean warn_multiple;
 
 struct inclist *inc_path(char *file, char *include, boolean dot, struct 
IncludesCollection *incCollection)
 {
diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index c156c19..997ba6d 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -120,16 +120,16 @@ void redirect(char * makefile);
 struct  inclist inclist[ MAXFILES ],
 *inclistp = inclist;
 
-struct symhash *maininclist = NULL;
+static struct symhash *maininclist = NULL;
 
 char*filelist[ MAXFILES ];
 char*includedirs[ MAXDIRS + 1 ];
 char*notdotdot[ MAXDIRS ];
 char*objprefix = "";
 char*objsuffix = OBJSUFFIX;
-char*startat = "# DO NOT DELETE";
-int width = 78;
-boolean append = FALSE;
+static char*startat = "# DO NOT DELETE";
+static int width = 78;
+static boolean append = FALSE;
 boolean printed = FALSE;
 boolean verbose = FALSE;
 boolean show_where_not = FALSE;
@@ -161,7 +161,7 @@ catch (int sig)
 struct sigaction sig_act;
 #endif /* USGISH */
 
-boolean native_win_slashes = FALSE;
+static boolean native_win_slashes = FALSE;
 
 int main(int argc, char**argv)
 {
diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c
index 01adafbb..250a6a6 100644
--- a/soltools/mkdepend/parse.c
+++ 

[Libreoffice-commits] core.git: soltools/cpp

2015-06-16 Thread Stephan Bergmann
 soltools/cpp/_tokens.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 6149c5c8352d1e5c45568b5551539175f5305d4d
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Jun 16 12:24:01 2015 +0200

-fsanitize=nonnull-attribute

Change-Id: Id214fb1f0decd4d39684a846c06ff97d8baa209d

diff --git a/soltools/cpp/_tokens.c b/soltools/cpp/_tokens.c
index e31ccbd..c764886 100644
--- a/soltools/cpp/_tokens.c
+++ b/soltools/cpp/_tokens.c
@@ -295,7 +295,8 @@ void
 size_t nby;
 
 nby = (char *) str-lp - (char *) str-bp;
-memmove(dtr-tp, str-bp, nby);
+if (nby)
+memmove(dtr-tp, str-bp, nby);
 }
 
 /*
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp

2014-04-10 Thread Stephan Bergmann
 soltools/cpp/_getopt.c |2 ++
 soltools/cpp/_getopt.h |   29 +
 soltools/cpp/_unix.c   |4 +---
 3 files changed, 32 insertions(+), 3 deletions(-)

New commits:
commit 691a54ccdf89489b64ea9dfffd07b824b2f1a964
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Apr 10 15:31:22 2014 +0200

Clean up function declaration

Change-Id: I92c54f61fe8608d788cc236956f4a5a58e20a7df

diff --git a/soltools/cpp/_getopt.c b/soltools/cpp/_getopt.c
index cbbfc82..82506fa 100644
--- a/soltools/cpp/_getopt.c
+++ b/soltools/cpp/_getopt.c
@@ -20,6 +20,8 @@
 #include stdio.h
 #include string.h
 
+#include _getopt.h
+
 #define EPR fprintf(stderr,
 #define ERR(str, chr)   if(opterr) { EPR %s%c\n, str, chr); }
 
diff --git a/soltools/cpp/_getopt.h b/soltools/cpp/_getopt.h
new file mode 100644
index 000..8a8fccd
--- /dev/null
+++ b/soltools/cpp/_getopt.h
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SOLTOOLS_CPP_GETOPT_H
+#define INCLUDED_SOLTOOLS_CPP_GETOPT_H
+
+int stgetopt(int, char *const *, const char *);
+extern char *optarg;
+extern int optind;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
index e5f9eab..d1cd208 100644
--- a/soltools/cpp/_unix.c
+++ b/soltools/cpp/_unix.c
@@ -32,9 +32,7 @@
 #include cpp.h
 
 #if defined MACOSX || defined AIX || defined WNT
-extern int stgetopt(int, char *const *, const char *);
-extern char *optarg;
-extern int optind;
+#include _getopt.h
 #else
 #include getopt.h
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp

2014-04-04 Thread Stephan Bergmann
 soltools/cpp/_unix.c |2 --
 soltools/cpp/cpp.h   |2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 247bfbdb46f0f89e784574791d2bbc8748dd3717
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Apr 4 10:29:04 2014 +0200

Move prototype to include

Change-Id: I90c093c704609429f9997f3ffed6a9a79c8956a6

diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
index d29970a..e5f9eab 100644
--- a/soltools/cpp/_unix.c
+++ b/soltools/cpp/_unix.c
@@ -49,8 +49,6 @@ int Cflag = 0;  /* do not remove any 
comments */
 int Dflag = 0;  /* add parameter check to delete op */
 int Cplusplus = 0;
 
-extern void setup_kwtab(void);
-
 void
 setup(int argc, char **argv)
 {
diff --git a/soltools/cpp/cpp.h b/soltools/cpp/cpp.h
index 15c2e60..5e57118 100644
--- a/soltools/cpp/cpp.h
+++ b/soltools/cpp/cpp.h
@@ -57,6 +57,8 @@ enum kwtype
 KMACHINE, KLINENO, KFILE, KDATE, KTIME, KSTDC, KEVAL
 };
 
+extern void setup_kwtab(void);
+
 #define ISDEFINED   0x01/* has #defined value */
 #define ISKW0x02/* is PP keyword */
 #define ISUNCHANGE  0x04/* can't be #defined in PP */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp sw/source

2014-03-31 Thread Stephan Bergmann
 soltools/cpp/_eval.c |   12 ++--
 sw/source/core/frmedt/tblsel.cxx |2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 1cc318bfe68d89015d8aa0d98e5e94fe72ec892a
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Mar 31 14:58:59 2014 +0200

Typo #elsif - #elif

Change-Id: I95d4dc2a3364172e8917d0a029564e9114943148

diff --git a/soltools/cpp/_eval.c b/soltools/cpp/_eval.c
index 22cb9ad..f10fa79 100644
--- a/soltools/cpp/_eval.c
+++ b/soltools/cpp/_eval.c
@@ -313,7 +313,7 @@ long
 *op++ = UMINUS;
 if (tp-type == STAR || tp-type == AND)
 {
-error(ERROR, Illegal operator * or  in #if/#elsif);
+error(ERROR, Illegal operator * or  in #if/#elif);
 return 0;
 }
 continue;
@@ -380,7 +380,7 @@ long
 /* fall through */
 
 default:
-error(ERROR, Bad operator (%t) in #if/#elsif, tp);
+error(ERROR, Bad operator (%t) in #if/#elif, tp);
 return 0;
 }
 }
@@ -390,14 +390,14 @@ long
 return 0;
 if (op != ops[1] || vp != vals[1])
 {
-error(ERROR, Botch in #if/#elsif);
+error(ERROR, Botch in #if/#elif);
 return 0;
 }
 if (vals[0].type == UND)
 error(ERROR, Undefined expression value);
 return vals[0].val;
 syntax:
-error(ERROR, Syntax error in #if/#elsif);
+error(ERROR, Syntax error in #if/#elif);
 return 0;
 }
 
@@ -679,7 +679,7 @@ struct value
 else
 {
 error(ERROR,
-  Bad number %t in #if/#elsif, tp);
+  Bad number %t in #if/#elif, tp);
 break;
 }
 }
@@ -761,7 +761,7 @@ struct value
 break;
 
 case STRING:
-error(ERROR, String in #if/#elsif);
+error(ERROR, String in #if/#elif);
 break;
 }
 return v;
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index f0a7423..e822758 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -1181,7 +1181,7 @@ void GetMergeSel( const SwPaM rPam, SwSelBoxes rBoxes,
 pUndo-SaveCollection( *aPosArr[ i ].pSelBox );
 aPosArr.Remove( nSttPos, n - nSttPos );
 }
-#elsif defined( DEL_EMPTY_BOXES_AT_START_AND_END )
+#elif defined( DEL_EMPTY_BOXES_AT_START_AND_END )
 
 nWidth = pFirstBox-GetFrmFmt()-GetFrmSize().GetWidth();
 sal_uInt16 n, nSttPos = 0, nSEndPos = 0, nESttPos = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: soltools/cpp

2013-11-16 Thread Jesús Corrius
 soltools/cpp/_include.c |2 +-
 soltools/cpp/_macro.c   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d83e581fb5074c575e942115b6930b00a81b21dd
Author: Jesús Corrius jcorr...@gmail.com
Date:   Sat Nov 16 14:53:12 2013 +0100

Fix for VS 2013 compilation

I don´t know why it doesn´t work anymore, but the fix is trivial
may be related of using the Windows 8.0 SDK.

Change-Id: Ia09109b53d4f022a732ea781c98ddd4eb0c721d9

diff --git a/soltools/cpp/_include.c b/soltools/cpp/_include.c
index 40ff092..7a9044b 100644
--- a/soltools/cpp/_include.c
+++ b/soltools/cpp/_include.c
@@ -31,7 +31,7 @@
 #include string.h
 #include fcntl.h
 
-#if defined(__IBMC__) || defined(__EMX__)
+#if defined(__IBMC__) || defined(__EMX__) || defined(_MSC_VER)
 #   include fcntl.h
 #   define PATH_MAX _MAX_PATH
 #endif
diff --git a/soltools/cpp/_macro.c b/soltools/cpp/_macro.c
index 251a1f6..b86af10 100644
--- a/soltools/cpp/_macro.c
+++ b/soltools/cpp/_macro.c
@@ -23,7 +23,7 @@
 #include stdio.h
 #include stdlib.h
 #include string.h
-#if defined(__IBMC__) || defined(__EMX__)
+#if defined(__IBMC__) || defined(__EMX__) || defined(_MSC_VER)
 #   define PATH_MAX _MAX_PATH
 #endif
 #include limits.h
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits