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

2022-12-07 Thread Stephan Bergmann (via logerrit)
 soltools/mkdepend/main.c |4 
 1 file changed, 4 insertions(+)

New commits:
commit cb26710b6b40df59f34dd6a65988cd55e32153b0
Author: Stephan Bergmann 
AuthorDate: Wed Dec 7 07:43:23 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 7 12:35:45 2022 +

Check for failed malloc

...thereby silencing

> In file included from /usr/include/features.h:490,
>  from /usr/include/bits/libc-header-start.h:33,
>  from /usr/include/stdio.h:27,
>  from soltools/mkdepend/def.h:40,
>  from soltools/mkdepend/main.c:58:
> In function ‘read’,
> inlined from ‘main’ at soltools/mkdepend/main.c:197:28:
> /usr/include/bits/unistd.h:38:10: error: ‘__read_alias’ specified size 
18446744073709551614 exceeds maximum object size 9223372036854775807 
[-Werror=stringop-overflow=]
>38 |   return __glibc_fortify (read, __nbytes, sizeof (char),
>   |  ^~~
> /usr/include/bits/unistd.h: In function ‘main’:
> /usr/include/bits/unistd.h:26:16: note: in a call to function 
‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’
>26 | extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf,
>   |^~

seen at least with -Wp,-D_FORTIFY_SOURCE=3 manually added to 
gb_COMPILEROPTFLAGS
in an --enable-optimized build against recent GCC 13 trunk

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

diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index b8b84b453476..708d2c3b53dd 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -77,6 +77,7 @@ typedef _W64 int   ssize_t;
 #endif
 
 #include 
+#include 
 
 #ifdef MINIX
 #define USE_CHMOD   1
@@ -194,6 +195,9 @@ int main(int argc, char**argv)
 fatalerr("cannot open \"%s\"\n", argv[1]+1);
 (void)fstat(afd, );
 args = (char *)malloc(ast.st_size + 1);
+if (args == NULL) {
+abort();
+}
 if ((ast.st_size = read(afd, args, (size_t) ast.st_size)) < 0)
 fatalerr("failed to read %s\n", argv[1]+1);
 args[ast.st_size] = '\0';


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

2022-06-03 Thread Stephan Bergmann (via logerrit)
 soltools/mkdepend/main.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 628082158aecf3d5aeb8732d7ddf5dacc45e4d18
Author: Stephan Bergmann 
AuthorDate: Fri Jun 3 14:01:31 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 3 15:09:09 2022 +0200

Revert "Better use size_t for malloc_size"

This reverts commit 652e4ee372e8939f48f69411b6326b237c6d9e4b.  Turns out on
Windows read (aka _read) actually has a parameter of type unsigned, not 
size_t,

(
"read"), so this started to cause

> 
C:/cygwin/home/tdf/jenkins/workspace/lo_tb_master_win64_dbg/soltools/mkdepend/main.c(504):
 error C2220: the following warning is treated as an error
> 
C:/cygwin/home/tdf/jenkins/workspace/lo_tb_master_win64_dbg/soltools/mkdepend/main.c(504):
 warning C4267: 'function': conversion from 'size_t' to 'unsigned int', 
possible loss of data

() for MSVC 
builds
targeting x64.

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

diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index 58633c830115..b8b84b453476 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -473,7 +473,7 @@ struct filepointer *getfile(char *file)
 struct stat st;
 off_t   size_backup;
 ssize_t bytes_read;
-size_t  malloc_size;
+unsignedmalloc_size;
 
 content = (struct filepointer *)malloc(sizeof(struct filepointer));
 if ((fd = open(file, O_RDONLY)) < 0) {
@@ -486,7 +486,7 @@ struct filepointer *getfile(char *file)
 
 size_backup = st.st_size;
 malloc_size = size_backup;
-/* Since off_t usually is larger than size_t, need to test for
+/* Since off_t usually is larger than unsigned, need to test for
  * truncation.
  */
 if ( (off_t)malloc_size != size_backup )


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

2022-06-03 Thread Stephan Bergmann (via logerrit)
 soltools/mkdepend/main.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 652e4ee372e8939f48f69411b6326b237c6d9e4b
Author: Stephan Bergmann 
AuthorDate: Fri Jun 3 11:40:45 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jun 3 13:23:49 2022 +0200

Better use size_t for malloc_size

...as both malloc and read, to which this is passed, take arguments of type
size_t, not unsigned

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

diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index b8b84b453476..58633c830115 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -473,7 +473,7 @@ struct filepointer *getfile(char *file)
 struct stat st;
 off_t   size_backup;
 ssize_t bytes_read;
-unsignedmalloc_size;
+size_t  malloc_size;
 
 content = (struct filepointer *)malloc(sizeof(struct filepointer));
 if ((fd = open(file, O_RDONLY)) < 0) {
@@ -486,7 +486,7 @@ struct filepointer *getfile(char *file)
 
 size_backup = st.st_size;
 malloc_size = size_backup;
-/* Since off_t usually is larger than unsigned, need to test for
+/* Since off_t usually is larger than size_t, need to test for
  * truncation.
  */
 if ( (off_t)malloc_size != size_backup )


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

2022-03-03 Thread Caolán McNamara (via logerrit)
 soltools/mkdepend/pr.c |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 896c097f1fa4bc9d2e5ea87a696c125bb335ecac
Author: Caolán McNamara 
AuthorDate: Wed Mar 2 21:24:27 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 3 10:15:26 2022 +0100

cid#1500573 silence Untrusted loop bound

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

diff --git a/soltools/mkdepend/pr.c b/soltools/mkdepend/pr.c
index 2b0825221df6..7911502ed813 100644
--- a/soltools/mkdepend/pr.c
+++ b/soltools/mkdepend/pr.c
@@ -67,6 +67,7 @@ void add_include(struct filepointer *filep, struct inclist 
*file, struct inclist
 if (!newfile->i_searched) {
 newfile->i_searched = TRUE;
 content = getfile(newfile->i_file);
+// coverity[tainted_data] - this is a build time tool
 find_includes(content, newfile, file_red, 0, failOK, incCollection, 
symbols);
 freefile(content);
 }


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

2019-09-12 Thread Noel Grandin (via logerrit)
 soltools/mkdepend/include.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 74c409853f2c7be9f70230f1923e72ef146a4a30
Author: Noel Grandin 
AuthorDate: Wed Sep 11 16:04:29 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 12 11:05:19 2019 +0200

gcc9.2.1 also warns about truncation here

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

diff --git a/soltools/mkdepend/include.c b/soltools/mkdepend/include.c
index c95af5451b47..153c62b86c28 100644
--- a/soltools/mkdepend/include.c
+++ b/soltools/mkdepend/include.c
@@ -243,13 +243,13 @@ int issymbolic(char *dir, char *component)
 struct stat st;
 charbuf[ BUFSIZ ], **pp;
 
-#if defined __GNUC__ && __GNUC__ == 8 && (__GNUC_MINOR__ == 2 || 
__GNUC_MINOR__ == 3) && !defined __clang__
+#if defined __GNUC__ && !defined __clang__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-truncation"
-// silence "‘snprintf’ output may be truncated before the last format 
character"
+// silence "‘snprintf’ output may be truncated before the last format 
character", from gcc 8.3 to at least 9.2.1
 #endif
 int n = snprintf(buf, BUFSIZ, "%s%s%s", dir, *dir ? "/" : "", component);
-#if defined __GNUC__ && __GNUC__ == 8 && (__GNUC_MINOR__ == 2 || 
__GNUC_MINOR__ == 3) && !defined __clang__
+#if defined __GNUC__ && !defined __clang__
 #pragma GCC diagnostic pop
 #endif
 assert(n < BUFSIZ);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-19 Thread Caolán McNamara (via logerrit)
 soltools/mkdepend/main.c |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 37afe1443ef35987e289d2419b78b200e6007fd5
Author: Caolán McNamara 
AuthorDate: Thu Jul 18 11:27:35 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 19 09:42:00 2019 +0200

cid#1448249 Identical code for different branches

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

diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index 51b6c8606cc9..7ee27c439f7d 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -272,7 +272,6 @@ int main(int argc, char**argv)
 break;
 /* do not use if endmarker processing */
 case 'a':
-if (endmarker) break;
 break;
 case 'w':
 if (endmarker) break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2018-11-26 Thread Libreoffice Gerrit user
 soltools/mkdepend/parse.c |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 313a0efb1d703a36030a7e5e55bd308c7e4650f3
Author: Noel Grandin 
AuthorDate: Mon Nov 26 09:04:22 2018 +0200
Commit: Noel Grandin 
CommitDate: Mon Nov 26 10:11:04 2018 +0100

file param is used in DEBUG mode

regression from
commit 4c19552052083b9b10d581f1a93f6ddecf241bcd
remove some unused enum values and defines in soltools

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

diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c
index 7a8e4f96e2ac..a25fd9cd2bcd 100644
--- a/soltools/mkdepend/parse.c
+++ b/soltools/mkdepend/parse.c
@@ -33,7 +33,7 @@ in this Software without prior written authorization from the 
X Consortium.
 static char *hash_lookup( char *symbol, struct symhash *symbols );
 static int gobble( struct filepointer *filep, struct inclist *file,
 struct inclist *file_red, struct symhash *symbols );
-static int deftype ( char *line, struct filepointer *filep,
+static int deftype ( char *line, struct filepointer *filep, struct inclist 
*file,
 int parse_it, struct symhash *symbols);
 static int zero_value(char const *exp, struct symhash *symbols);
 
@@ -45,7 +45,7 @@ int find_includes(struct filepointer *filep, struct inclist 
*file, struct inclis
 inttype;
 
 while ((line = get_line(filep))) {
-type = deftype(line, filep, TRUE, symbols);
+type = deftype(line, filep, file, TRUE, symbols);
 switch(type) {
 case IF:
 doif:
@@ -106,7 +106,7 @@ int gobble(struct filepointer *filep,
 inttype;
 
 while ((line = get_line(filep))) {
-type = deftype(line, filep, FALSE, symbols);
+type = deftype(line, filep, file, FALSE, symbols);
 switch(type) {
 case IF:
 case IFFALSE:
@@ -133,11 +133,13 @@ int gobble(struct filepointer *filep,
 /*
  * Decide what type of # directive this line is.
  */
-int deftype (char *line, struct filepointer *filep, int parse_it, struct 
symhash *symbols)
+int deftype (char *line, struct filepointer *filep, struct inclist * file,
+int parse_it, struct symhash *symbols)
 {
 char   *p;
 char*directive, savechar;
 intret;
+(void)file; // used in DEBUG mode
 (void)filep;
 /*
  * Parse the directive...
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-11-08 Thread Libreoffice Gerrit user
 soltools/mkdepend/include.c |8 
 1 file changed, 8 insertions(+)

New commits:
commit f0f1ae6e9fd7f8d2a5b64909071f3321b5eada4d
Author: Stephan Bergmann 
AuthorDate: Thu Nov 8 09:31:32 2018 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Nov 8 12:19:30 2018 +0100

Silence GCC 8.2.1 -Werror=format-truncation=

After 09841225fc055f8270cee3059253f923dd544797 "soltools: fix
-Werror=format-overflow" changed the sprintf into an snprintf, at least the
Fedora 29 "gcc (GCC) 8.2.1 20181011 (Red Hat 8.2.1-4)" now complains about

> [C  ] soltools/mkdepend/include.c
> soltools/mkdepend/include.c: In function ‘remove_dotdot.constprop’:
> soltools/mkdepend/include.c:246:42: error: ‘snprintf’ output may be 
truncated before the last format character [-Werror=format-truncation=]
>  int n = snprintf(buf, BUFSIZ, "%s%s%s", dir, *dir ? "/" : "", 
component);
>   ^
> soltools/mkdepend/include.c:246:13: note: ‘snprintf’ output 1 or more 
bytes (assuming 8193) into a destination of size 8192
>  int n = snprintf(buf, BUFSIZ, "%s%s%s", dir, *dir ? "/" : "", 
component);
>  
^~~~

This all looks not very helpful, lets limit the silencing to just GCC 8.2 
(in
the hopes that later versions of GCC won't emit that warning any more, 
anyway).

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

diff --git a/soltools/mkdepend/include.c b/soltools/mkdepend/include.c
index 26a237bc827e..f47b9d8efeab 100644
--- a/soltools/mkdepend/include.c
+++ b/soltools/mkdepend/include.c
@@ -243,7 +243,15 @@ int issymbolic(char *dir, char *component)
 struct stat st;
 charbuf[ BUFSIZ ], **pp;
 
+#if defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 2 && !defined 
__clang__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-truncation"
+// silence "‘snprintf’ output may be truncated before the last format 
character"
+#endif
 int n = snprintf(buf, BUFSIZ, "%s%s%s", dir, *dir ? "/" : "", component);
+#if defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 2 && !defined 
__clang__
+#pragma GCC diagnostic pop
+#endif
 assert(n < BUFSIZ);
 (void) n;
 for (pp=notdotdot; *pp; pp++)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-04 Thread Libreoffice Gerrit user
 soltools/mkdepend/include.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 09841225fc055f8270cee3059253f923dd544797
Author: Michael Stahl 
AuthorDate: Thu Oct 4 16:20:06 2018 +0200
Commit: Julien Nabet 
CommitDate: Fri Oct 5 07:12:59 2018 +0200

soltools: fix -Werror=format-overflow

error: ‘sprintf’ may write a terminating nul past the end of the destination

(Why does GCC8 complain about this now and not before?)

Change-Id: I62cd9dec02d313b5aff1afc4cadf38ca1909ffb1
Reviewed-on: https://gerrit.libreoffice.org/61381
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/soltools/mkdepend/include.c b/soltools/mkdepend/include.c
index dbc282845435..26a237bc827e 100644
--- a/soltools/mkdepend/include.c
+++ b/soltools/mkdepend/include.c
@@ -30,6 +30,7 @@ in this Software without prior written authorization from the 
X Consortium.
 
 #include "def.h"
 #include 
+#include 
 
 static void remove_dotdot( char * );
 static int isdot( char const * );
@@ -242,7 +243,9 @@ int issymbolic(char *dir, char *component)
 struct stat st;
 charbuf[ BUFSIZ ], **pp;
 
-sprintf(buf, "%s%s%s", dir, *dir ? "/" : "", component);
+int n = snprintf(buf, BUFSIZ, "%s%s%s", dir, *dir ? "/" : "", component);
+assert(n < BUFSIZ);
+(void) n;
 for (pp=notdotdot; *pp; pp++)
 if (strcmp(*pp, buf) == 0)
 return TRUE;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-09-24 Thread Libreoffice Gerrit user
 soltools/mkdepend/include.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ec709a8d5e808b970a8930a389c0a5a6f61fe8c7
Author: Stephan Bergmann 
AuthorDate: Mon Sep 24 15:21:18 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Sep 24 16:47:40 2018 +0200

-Werror,-Wunused-variable (clang-cl)

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

diff --git a/soltools/mkdepend/include.c b/soltools/mkdepend/include.c
index 50fdcb9b9ee4..dbc282845435 100644
--- a/soltools/mkdepend/include.c
+++ b/soltools/mkdepend/include.c
@@ -37,8 +37,9 @@ static int isdotdot( char const * );
 static int issymbolic(char * dir, char * component);
 static int exists_path(struct IncludesCollection*, char*);
 
-
+#ifdef S_IFLNK
 static char *notdotdot[ MAXDIRS ];
+#endif
 
 struct inclist *inc_path(char *file, char *include, boolean dot, struct 
IncludesCollection *incCollection)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-09-16 Thread Libreoffice Gerrit user
 soltools/mkdepend/def.h |3 +++
 soltools/mkdepend/include.c |   14 ++
 soltools/mkdepend/main.c|   13 ++---
 soltools/mkdepend/parse.c   |   10 +-
 soltools/mkdepend/pr.c  |5 ++---
 5 files changed, 22 insertions(+), 23 deletions(-)

New commits:
commit ffe2b51a4919fb64a8debecb724d1e959abf343a
Author: Stephan Bergmann 
AuthorDate: Sat Sep 15 19:09:38 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Sep 17 07:30:56 2018 +0200

loplugin:external in Executable_mkdepend

...moving notdotdot to include.c (and some other decls to def.h)

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

diff --git a/soltools/mkdepend/def.h b/soltools/mkdepend/def.h
index 009d32772d27..ed8b5faadcaa 100644
--- a/soltools/mkdepend/def.h
+++ b/soltools/mkdepend/def.h
@@ -189,8 +189,11 @@ char *append_slash(char *);
 
 extern char * directives[];
 
+extern struct inclist inclist[ MAXFILES ];
 extern struct inclist * inclistp;
 
+extern char *includedirs[ ];
+
 extern char * objprefix;
 
 extern char * objsuffix;
diff --git a/soltools/mkdepend/include.c b/soltools/mkdepend/include.c
index 4fbc651f15a9..50fdcb9b9ee4 100644
--- a/soltools/mkdepend/include.c
+++ b/soltools/mkdepend/include.c
@@ -31,16 +31,14 @@ in this Software without prior written authorization from 
the X Consortium.
 #include "def.h"
 #include 
 
-void remove_dotdot( char * );
-int isdot( char const * );
-int isdotdot( char const * );
-int issymbolic(char * dir, char * component);
-int exists_path(struct IncludesCollection*, char*);
+static void remove_dotdot( char * );
+static int isdot( char const * );
+static int isdotdot( char const * );
+static int issymbolic(char * dir, char * component);
+static int exists_path(struct IncludesCollection*, char*);
 
 
-extern struct inclist inclist[ MAXFILES ];
-extern char *includedirs[ ];
-extern char *notdotdot[ ];
+static char *notdotdot[ MAXDIRS ];
 
 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 dcd86838f7da..a32e0dd38316 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -85,7 +85,7 @@ typedef _W64 int   ssize_t;
 int _debugmask;
 #endif
 
-char *ProgramName;
+static char *ProgramName;
 
 #define OBJSUFFIX ".obj"
 #define INCLUDEDIR "."
@@ -115,16 +115,15 @@ char*directives[] = {
 
 /***   function declarations /
 /***   added by -Wall project ***/
-void redirect(char * makefile);
+static void redirect(char * makefile);
 
-struct  inclist inclist[ MAXFILES ],
-*inclistp = inclist;
+struct  inclist inclist[ MAXFILES ];
+struct  inclist *inclistp = inclist;
 
 static struct symhash *maininclist = NULL;
 
-char*filelist[ MAXFILES ];
+static char*filelist[ MAXFILES ];
 char*includedirs[ MAXDIRS + 1 ];
-char*notdotdot[ MAXDIRS ];
 char*objprefix = "";
 char*objsuffix = OBJSUFFIX;
 static char*startat = "# DO NOT DELETE";
@@ -158,7 +157,7 @@ catch (int sig)
 #define sa_mask sv_mask
 #define sa_flags sv_flags
 #endif
-struct sigaction sig_act;
+static struct sigaction sig_act;
 #endif /* USGISH */
 
 static boolean native_win_slashes = FALSE;
diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c
index 23aa67849b49..94533a49f6ce 100644
--- a/soltools/mkdepend/parse.c
+++ b/soltools/mkdepend/parse.c
@@ -30,13 +30,13 @@ in this Software without prior written authorization from 
the X Consortium.
 #include 
 
 #include "def.h"
-char *hash_lookup( char *symbol, struct symhash *symbols );
-void hash_undefine( char *symbol, struct symhash *symbols );
-int gobble( struct filepointer *filep, struct inclist *file,
+static char *hash_lookup( char *symbol, struct symhash *symbols );
+static void hash_undefine( char *symbol, struct symhash *symbols );
+static int gobble( struct filepointer *filep, struct inclist *file,
 struct inclist *file_red, struct symhash *symbols );
-int deftype ( char *line, struct filepointer *filep, struct inclist *file,
+static int deftype ( char *line, struct filepointer *filep, struct inclist 
*file,
 int parse_it, struct symhash *symbols);
-int zero_value(char const *exp, struct symhash *symbols);
+static int zero_value(char const *exp, struct symhash *symbols);
 
 extern struct symhash *maininclist;
 
diff --git a/soltools/mkdepend/pr.c b/soltools/mkdepend/pr.c
index 9fd88877a8fd..4fe0b4ada2fa 100644
--- a/soltools/mkdepend/pr.c
+++ b/soltools/mkdepend/pr.c
@@ -29,9 +29,8 @@ in this Software without prior written authorization from the 
X Consortium.
 
 #include "def.h"
 #include 
-size_t pr( struct inclist *ip, char *file,char *base);
+static size_t pr( struct inclist *ip, char *file,char *base);
 
-extern struct   inclist inclist[ MAXFILES ];
 extern int  width;
 
 void 

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

2018-05-27 Thread Andrea Gelmini
 soltools/mkdepend/ifparser.h   |2 +-
 vcl/source/font/PhysicalFontCollection.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c73c8475d05ee1ccc9a53ee1bf68313f52bb45a5
Author: Andrea Gelmini 
Date:   Sun May 27 15:54:25 2018 +0200

Fix typos

Change-Id: I4924e62af79ba225a4cc9ed2f122854318b9
Reviewed-on: https://gerrit.libreoffice.org/54883
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/soltools/mkdepend/ifparser.h b/soltools/mkdepend/ifparser.h
index 5c3c0dbb6b79..25da651c158a 100644
--- a/soltools/mkdepend/ifparser.h
+++ b/soltools/mkdepend/ifparser.h
@@ -48,7 +48,7 @@
  *   |  '&' |  '|'
  *   |  '&&'|  '||'
  *
- * The normal C order of precidence is supported.
+ * The normal C order of precedence is supported.
  *
  *
  * External Entry Points:
diff --git a/vcl/source/font/PhysicalFontCollection.cxx 
b/vcl/source/font/PhysicalFontCollection.cxx
index fcdef005dfdd..343f6054364f 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -1182,7 +1182,7 @@ PhysicalFontFamily* 
PhysicalFontCollection::FindFontFamily( FontSelectPattern& r
 utl::FontSubstConfiguration::getMapName( aSearchName, aTempShortName, 
aTempFamilyName,
  eTempWeight, eTempWidth, 
nTempType );
 
-// use a shortend token name if available
+// use a shortened token name if available
 if( aTempShortName != aSearchName )
 {
 PhysicalFontFamily* pFoundData = ImplFindFontFamilyBySearchName( 
aTempShortName );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-11 Thread Noel Grandin
 soltools/mkdepend/parse.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 920447d4a5df9a4f27726a943417e946108ad3ac
Author: Noel Grandin 
Date:   Thu Jan 11 15:44:53 2018 +0200

tdf#114952 filep is still used in soltools/mkdepend/parse.c

regression from

commit 18f513145477d4621290253d936dad7a40ee4c05
Date:   Tue Jun 20 19:54:23 2017 +0200
loplugin:unusedfields store..svl

somewhat tricky to reproduce on linux, I had to do

make soltools CPPFLAGS=-DDEBUG

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

diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c
index b538c87be22b..8aa05547bbe7 100644
--- a/soltools/mkdepend/parse.c
+++ b/soltools/mkdepend/parse.c
@@ -34,7 +34,7 @@ char *hash_lookup( char *symbol, struct symhash *symbols );
 void hash_undefine( char *symbol, struct symhash *symbols );
 int gobble( struct filepointer *filep, struct inclist *file,
 struct inclist *file_red, struct symhash *symbols );
-int deftype ( char *line, struct inclist *file,
+int deftype ( char *line, struct filepointer *filep, struct inclist *file,
 int parse_it, struct symhash *symbols);
 int zero_value(char const *exp, struct symhash *symbols);
 
@@ -47,7 +47,7 @@ int find_includes(struct filepointer *filep, struct inclist 
*file, struct inclis
 boolean recfailOK;
 
 while ((line = get_line(filep))) {
-switch(type = deftype(line, file, TRUE, symbols)) {
+switch(type = deftype(line, filep, file, TRUE, symbols)) {
 case IF:
 doif:
 type = find_includes(filep, file,
@@ -170,7 +170,7 @@ int gobble(struct filepointer *filep,
 inttype;
 
 while ((line = get_line(filep))) {
-switch(type = deftype(line, file, FALSE, symbols)) {
+switch(type = deftype(line, filep, file, FALSE, symbols)) {
 case IF:
 case IFFALSE:
 case IFGUESSFALSE:
@@ -215,12 +215,12 @@ int gobble(struct filepointer *filep,
 /*
  * Decide what type of # directive this line is.
  */
-int deftype (char *line, struct inclist *file, int parse_it, struct symhash 
*symbols)
+int deftype (char *line, struct filepointer *filep, struct inclist *file, int 
parse_it, struct symhash *symbols)
 {
 char   *p;
 char*directive, savechar;
 intret;
-
+(void)filep;
 /*
  * Parse the directive...
  */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-04-10 Thread Pedro Giffuni
 soltools/mkdepend/main.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 429a15cc292a92c2f00be6febde7da66ed792b70
Author: Pedro Giffuni 
Date:   Sun Apr 10 02:27:05 2016 +

Drop redundant parenthesis.

Found with coccinelle:  http://coccinelle.lip6.fr/

Currently only applied to C code.

(cherry picked from commit aaf15142bcbc44f0e06a3357d2b21ecf9c673d21)

Change-Id: I7d43b024752ebd47e84e2e51028f8fd132410800

diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index fad3737..c156c19 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -634,9 +634,9 @@ char *base_name(char *file)
 if ( *p == '/' ||  *p == '\\') {
 file = p + 1;
 break;
-};
+}
 p--;
-};
+}
 return file;
 }
 
@@ -711,7 +711,7 @@ void convert_slashes(char *path)
 for (ptr = (char*)path; *ptr; ++ptr)
 if (*ptr == '\\')
 *ptr = '/';
-};
+}
 #else
 (void)path;
 #endif
@@ -730,7 +730,7 @@ char* append_slash(char *path)
 strcat(new_string, "\\");
 else
 strcat(new_string, "/");
-};
+}
 return new_string;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-03-02 Thread Caolán McNamara
 soltools/mkdepend/main.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7953f59a7caed35cda14300ddb1654d4efe4
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Mar 2 11:04:04 2015 +

V804: Decreased performance

Change-Id: I6430442cc407e02810d849cf60833abe7c7d2830

diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index 93c971d..3641f4f 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -717,7 +717,8 @@ void convert_slashes(char *path)
 char* append_slash(char *path)
 {
 char *new_string;
-if ((path[strlen(path) - 1] == '/') || (path[strlen(path) - 1] == '\\')) {
+const char cLastChar = path[strlen(path) - 1];
+if (cLastChar == '/' || cLastChar == '\\') {
 new_string = path;
 } else {
 new_string = (char*)malloc(sizeof(char) * (strlen(path) + 2));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-12-09 Thread Stephan Bergmann
 soltools/mkdepend/cppsetup.c |6 +++---
 soltools/mkdepend/ifparser.c |6 +++---
 soltools/mkdepend/ifparser.h |4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 7e12a6cccb42711c0399bbcd0e7cc3008f56cd2f
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Dec 9 10:24:09 2014 +0100

warning C4267: conversion from 'size_t' to 'int' (MSVC 64-bit)

Change-Id: I2fa40ebe467a65b0d6023883a14c79ff4303bb2f

diff --git a/soltools/mkdepend/cppsetup.c b/soltools/mkdepend/cppsetup.c
index 3833530..c57fe0c 100644
--- a/soltools/mkdepend/cppsetup.c
+++ b/soltools/mkdepend/cppsetup.c
@@ -151,7 +151,7 @@ _my_if_errors (IfParser *ip, const char *cp, const char 
*expecting)
 #define MAXNAMELEN 256
 
 char *
-_lookup_variable (const char *var, int len)
+_lookup_variable (const char *var, size_t len)
 {
 char tmpbuf[MAXNAMELEN + 1];
 
@@ -165,7 +165,7 @@ _lookup_variable (const char *var, int len)
 
 
 static int
-_my_eval_defined (IfParser *ip, const char *var, int len)
+_my_eval_defined (IfParser *ip, const char *var, size_t len)
 {
 (void)ip;
 if (_lookup_variable (var, len))
@@ -177,7 +177,7 @@ _my_eval_defined (IfParser *ip, const char *var, int len)
 #define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
 
 static int
-_my_eval_variable (IfParser *ip, const char *var, int len)
+_my_eval_variable (IfParser *ip, const char *var, size_t len)
 {
 char *s;
 
diff --git a/soltools/mkdepend/ifparser.c b/soltools/mkdepend/ifparser.c
index d342aa0..39d3642 100644
--- a/soltools/mkdepend/ifparser.c
+++ b/soltools/mkdepend/ifparser.c
@@ -157,7 +157,7 @@ parse_value (IfParser *g, const char *cp, int *valp)
   case 'd':
 if (strncmp (cp, defined, 7) == 0  !isalnum(cp[7])) {
 int paren = 0;
-int len;
+size_t len;
 
 cp += 7;
 SKIPSPACE (cp);
@@ -166,7 +166,7 @@ parse_value (IfParser *g, const char *cp, int *valp)
   cp++;
 }
 DO (cp = parse_variable (g, cp, var));
-len = (int)(cp - var);
+len = (size_t)(cp - var);
 SKIPSPACE (cp);
 if (paren  *cp != ')')
 return CALLFUNC(g, handle_error) (g, cp, ));
@@ -182,7 +182,7 @@ parse_value (IfParser *g, const char *cp, int *valp)
   return CALLFUNC(g, handle_error) (g, cp, variable or number);
 else {
   DO (cp = parse_variable (g, cp, var));
-  *valp = (*(g-funcs.eval_variable)) (g, var, cp - var);
+  *valp = (*(g-funcs.eval_variable)) (g, var, (size_t)(cp - var));
 }
 
 return cp;
diff --git a/soltools/mkdepend/ifparser.h b/soltools/mkdepend/ifparser.h
index 97d7482..dbc1e86 100644
--- a/soltools/mkdepend/ifparser.h
+++ b/soltools/mkdepend/ifparser.h
@@ -65,8 +65,8 @@ typedef int Bool;
 typedef struct _if_parser {
 struct {/* functions */
   const char *(*handle_error)  (struct _if_parser *, const char *, const 
char *);
-  int (*eval_variable) (struct _if_parser *, const char *, int);
-  int (*eval_defined)  (struct _if_parser *, const char *, int);
+  int (*eval_variable) (struct _if_parser *, const char *, size_t);
+  int (*eval_defined)  (struct _if_parser *, const char *, size_t);
 } funcs;
 char *data;
 } IfParser;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-12-09 Thread Stephan Bergmann
 soltools/mkdepend/include.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b5e9d7e83419c1c7e143732ad162d6fc56882de8
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Dec 9 10:38:41 2014 +0100

warning C4267: conversion from 'size_t' to 'int' (MSVC 64-bit)

Change-Id: Ife7d223f5e751e246c537561d3ce24395b4c9f3b

diff --git a/soltools/mkdepend/include.c b/soltools/mkdepend/include.c
index d1d05a3..4cfbff7 100644
--- a/soltools/mkdepend/include.c
+++ b/soltools/mkdepend/include.c
@@ -104,7 +104,7 @@ struct inclist *inc_path(char *file, char *include, boolean 
dot, struct Includes
 else
 {
 int partial = (p - file);
-int inc_len = strlen(include);
+size_t inc_len = strlen(include);
 if(inc_len + partial = BUFSIZ )
 {
 fatalerr(include filename too long \%s\\n, include);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-09-04 Thread Caolán McNamara
 soltools/mkdepend/main.c |   79 ++-
 1 file changed, 5 insertions(+), 74 deletions(-)

New commits:
commit 3e835154a7af929fd18683af85c28efabd498d41
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Sep 3 22:59:10 2014 +0100

coverity#1019334 Explicit null dereferenced

Change-Id: I22b85cbfda1c1bd705b35095e03cfae4071d2fb7

diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index b8dde42..6cbcf12 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -115,7 +115,7 @@ char*directives[] = {
 
 /***   function declarations /
 /***   added by -Wall project ***/
-void redirect(char * line, char * makefile );
+void redirect(char * makefile);
 
 struct  inclist inclist[ MAXFILES ],
 *inclistp = inclist;
@@ -375,7 +375,7 @@ int main(int argc, char**argv)
 *incp++ = defincdir;
 }
 
-redirect(startat, makefile);
+redirect(makefile);
 
 /*
  * catch signals.
@@ -650,81 +650,12 @@ int rename (char *from, char *to)
 }
 #endif /* USGISH */
 
-void redirect(char *line, char *makefile)
+void redirect(char *makefile)
 {
 FILE*fdout;
-fdout = freopen(makefile, wb, stdout); // binary mode please
+fdout = makefile ? freopen(makefile, wb, stdout) : NULL; // binary mode 
please
 if (fdout == NULL)
-fatalerr(cannot open \%s\\n, makefile);
-(void) line;
-
-// don't need any of that nonsense
-#if 0
-struct stat st;
-FILE*fdin, *fdout;
-charbackup[ BUFSIZ ],
-buf[ BUFSIZ ];
-boolean found = FALSE;
-int len;
-
-/*
- * if makefile is - then let it pour onto stdout.
- */
-if (makefile  *makefile == '-'  *(makefile+1) == '\0')
-return;
-
-/*
- * use a default makefile is not specified.
- */
-if (!makefile) {
-if (stat(Makefile, st) == 0)
-makefile = Makefile;
-else if (stat(makefile, st) == 0)
-makefile = makefile;
-else
-fatalerr([mM]akefile is not present\n);
-}
-else
-stat(makefile, st);
-if ((fdin = fopen(makefile, r)) == NULL)
-fatalerr(cannot open \%s\\n, makefile);
-sprintf(backup, %s.bak, makefile);
-unlink(backup);
-#if defined(WIN32)
-fclose(fdin);
-#endif
-if (rename(makefile, backup)  0)
-fatalerr(cannot rename %s to %s\n, makefile, backup);
-#if defined(WIN32)
-if ((fdin = fopen(backup, r)) == NULL)
-fatalerr(cannot open \%s\\n, backup);
-#endif
-if ((fdout = freopen(makefile, w, stdout)) == NULL)
-fatalerr(cannot open \%s\\n, backup);
-len = strlen(line);
-while (!found  fgets(buf, BUFSIZ, fdin)) {
-if (*buf == '#'  strncmp(line, buf, len) == 0)
-found = TRUE;
-fputs(buf, fdout);
-}
-if (!found) {
-if (verbose)
-warning(Adding new delimiting line \%s\ and dependencies...\n,
-line);
-puts(line); /* same as fputs(fdout); but with newline */
-} else if (append) {
-while (fgets(buf, BUFSIZ, fdin)) {
-fputs(buf, fdout);
-}
-}
-fflush(fdout);
-#if defined(USGISH) || defined(USE_CHMOD)
-chmod(makefile, st.st_mode);
-#else
-fchmod(fileno(fdout), st.st_mode);
-#endif /* USGISH */
-fclose(fdin);
-#endif
+fatalerr(cannot open \%s\\n, makefile ? makefile : NULL);
 }
 
 void fatalerr(char *msg, ...)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-24 Thread Noel Grandin
 soltools/mkdepend/cppsetup.c |   15 +-
 soltools/mkdepend/def.h  |   18 +--
 soltools/mkdepend/ifparser.c |  235 +--
 soltools/mkdepend/ifparser.h |7 -
 soltools/mkdepend/include.c  |   38 ++
 soltools/mkdepend/main.c |   33 ++
 soltools/mkdepend/parse.c|   64 ---
 soltools/mkdepend/pr.c   |   14 --
 8 files changed, 186 insertions(+), 238 deletions(-)

New commits:
commit 0a0c70e05aab5f98f465e5155df3d40a9a423afe
Author: Noel Grandin n...@peralex.com
Date:   Tue Jun 24 13:07:36 2014 +0200

mkdepend: cleanup indentation and function declarations

to make it easier to read

Change-Id: Iff0fe055c12358edc1be335ec83d0855cc32f03c
Reviewed-on: https://gerrit.libreoffice.org/9877
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/soltools/mkdepend/cppsetup.c b/soltools/mkdepend/cppsetup.c
index 9f6dc63..3833530 100644
--- a/soltools/mkdepend/cppsetup.c
+++ b/soltools/mkdepend/cppsetup.c
@@ -187,20 +187,17 @@ _my_eval_variable (IfParser *ip, const char *var, int len)
 if (!s)
 return 0;
 do {
-var = s;
-if (!isvarfirstletter(*var))
+  var = s;
+  if (!isvarfirstletter(*var))
 break;
-s = _lookup_variable (var, strlen(var));
+  s = _lookup_variable (var, strlen(var));
 } while (s);
 
 return atoi(var);
 }
 
 
-int cppsetup(line, filep, inc)
-char   *line;
-struct filepointer *filep;
-struct inclist *inc;
+int cppsetup(char *line, struct filepointer *filep, struct inclist *inc)
 {
 IfParser ip;
 struct _parse_data pd;
@@ -216,9 +213,9 @@ int cppsetup(line, filep, inc)
 
 (void) ParseIfExpression (ip, line, val);
 if (val)
-return IF;
+  return IF;
 else
-return IFFALSE;
+  return IFFALSE;
 }
 #endif /* CPP */
 
diff --git a/soltools/mkdepend/def.h b/soltools/mkdepend/def.h
index 0515e42e..3ad3e16 100644
--- a/soltools/mkdepend/def.h
+++ b/soltools/mkdepend/def.h
@@ -125,15 +125,15 @@ struct symhash {
 };
 
 struct  inclist {
-char*i_incstring;   /* string from #include line */
-char*i_file;/* path name of the include file */
-struct inclist  **i_list;   /* list of files it itself includes */
-int i_listlen;  /* length of i_list */
-boolean i_defchecked;   /* whether defines have been checked */
-boolean i_notified; /* whether we have revealed includes */
-boolean i_marked;   /* whether it's in the makefile */
-boolean i_searched; /* whether we have read this */
-boolean i_included_sym; /* whether #include SYMBOL was found */
+char*i_incstring;  /* string from #include line */
+char*i_file;   /* path name of the include file */
+struct inclist  **i_list;  /* list of files it itself includes */
+int i_listlen; /* length of i_list */
+boolean i_defchecked;  /* whether defines have been checked */
+boolean i_notified;/* whether we have revealed includes */
+boolean i_marked;  /* whether it's in the makefile */
+boolean i_searched;/* whether we have read this */
+boolean i_included_sym; /* whether #include SYMBOL was found */
 /* Can't use i_list if TRUE */
 };
 
diff --git a/soltools/mkdepend/ifparser.c b/soltools/mkdepend/ifparser.c
index f9b4b66..d342aa0 100644
--- a/soltools/mkdepend/ifparser.c
+++ b/soltools/mkdepend/ifparser.c
@@ -123,66 +123,66 @@ parse_value (IfParser *g, const char *cp, int *valp)
 
 switch (*cp) {
   case '(':
-DO (cp = ParseIfExpression (g, cp + 1, valp));
-SKIPSPACE (cp);
-if (*cp != ')')
-return CALLFUNC(g, handle_error) (g, cp, ));
+DO (cp = ParseIfExpression (g, cp + 1, valp));
+SKIPSPACE (cp);
+if (*cp != ')')
+return CALLFUNC(g, handle_error) (g, cp, ));
 
-return cp + 1;  /* skip the right paren */
+return cp + 1;  /* skip the right paren */
 
   case '!':
-DO (cp = parse_value (g, cp + 1, valp));
-*valp = !(*valp);
-return cp;
+DO (cp = parse_value (g, cp + 1, valp));
+*valp = !(*valp);
+return cp;
 
   case '-':
-DO (cp = parse_value (g, cp + 1, valp));
-*valp = -(*valp);
-return cp;
+DO (cp = parse_value (g, cp + 1, valp));
+*valp = -(*valp);
+return cp;
 
   case '#':
-DO (cp = parse_variable (g, cp + 1, var));
-SKIPSPACE (cp);
-if (*cp != '(')
-return CALLFUNC(g, handle_error) (g, cp, ();
-do {
 DO (cp = parse_variable (g, cp + 1, var));
 SKIPSPACE (cp);
-} while (*cp  *cp != ')');
-if (*cp != ')')
-return CALLFUNC(g, handle_error) (g, cp, ));
-*valp = 1; /* XXX */
-return cp + 1;
+if (*cp != '(')
+return CALLFUNC(g, handle_error) (g, cp, ();
+do {

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

2013-08-30 Thread Tor Lillqvist
 soltools/mkdepend/main.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 803b669ec4c1a1052c0ea129fc7e689005e0dddf
Author: Tor Lillqvist t...@iki.fi
Date:   Fri Aug 30 10:29:16 2013 +0300

WaE: size_t/unsigned int: possible loss of data

With MSVC, the third parameter to read() is unsigned int.

Change-Id: I607089fb2a9e6bf794293187be48e910ac40158f

diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index 149bae1..b636498 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -482,7 +482,7 @@ struct filepointer *getfile(file)
 struct stat st;
 off_t   size_backup;
 ssize_t bytes_read;
-size_t  malloc_size;
+unsignedmalloc_size;
 
 content = (struct filepointer *)malloc(sizeof(struct filepointer));
 if ((fd = open(file, O_RDONLY))  0) {
@@ -495,13 +495,13 @@ struct filepointer *getfile(file)
 
 size_backup = st.st_size;
 malloc_size = size_backup;
-/* Since off_t is larger than size_t, need to test for
+/* Since off_t usually is larger than unsigned, need to test for
  * truncation.
  */
 if ( (off_t)malloc_size != size_backup )
 {
 close( fd );
-warning(makedepend:  File \%s\ size larger than can fit in size_t.  
Cannot allocate memory for contents.\n, file);
+warning(makedepend:  File \%s\ is too large.\n, file);
 content-f_p = content-f_base = content-f_end = (char *)malloc(1);
 *content-f_p = '\0';
 return(content);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-24 Thread Stephan Bergmann
 soltools/mkdepend/pr.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6681432e39228deb982105caa8de2319c2084a08
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Apr 24 22:51:26 2013 +0200

error: too many arguments in call to 'pr_dummy' [-Werror]

Change-Id: Ib03b6d3af9909c971245314bbde2085d8c3c73b2

diff --git a/soltools/mkdepend/pr.c b/soltools/mkdepend/pr.c
index e620078..6ebb01a 100644
--- a/soltools/mkdepend/pr.c
+++ b/soltools/mkdepend/pr.c
@@ -96,7 +96,7 @@ void recursive_pr_dummy(head, file)
 return;
 head-i_marked = 2; // it's a large boolean...
 if (head-i_file != file)
-pr_dummy(head, file);
+pr_dummy(head);
 for (i=0; ihead-i_listlen; i++)
 recursive_pr_dummy(head-i_list[ i ], file);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits