summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2015-02-08 04:27:11 +0100
committerMichael Stahl <mstahl@redhat.com>2015-02-09 16:21:45 +0000
commit4bcfde41e7b854769f7db7412749d7f0f9ad977e (patch)
tree7f914a47020edea1f1cf75de7f860ff01dec3b2a
parent81cb993127d0e399b1c9888fe4f4655b831593d9 (diff)
Werror: data lost during conversion from size_t to int
Change-Id: Iee080b89cf0588c8076ef4c0334d36a7aefce44d Reviewed-on: https://gerrit.libreoffice.org/14374 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rwxr-xr-x[-rw-r--r--]rsc/source/rscpp/cpp.h4
-rwxr-xr-x[-rw-r--r--]rsc/source/rscpp/cpp4.c4
-rwxr-xr-x[-rw-r--r--]rsc/source/rscpp/cpp6.c9
3 files changed, 9 insertions, 8 deletions
diff --git a/rsc/source/rscpp/cpp.h b/rsc/source/rscpp/cpp.h
index af579fe6303e..c9421412e57a 100644..100755
--- a/rsc/source/rscpp/cpp.h
+++ b/rsc/source/rscpp/cpp.h
@@ -336,8 +336,8 @@ int scanstring( int c, void (*outfun)( int c ) );
void scannumber( int c, void (*outfun)( int c ) );
void save( int c );
char* savestring( char* text );
-FILEINFO* getfile( int bufsize, char* name );
-char *getmem( int size );
+FILEINFO* getfile( size_t bufsize, char* name );
+char *getmem( size_t size );
DEFBUF* lookid( int c );
DEFBUF* defendel( char* name, int delete );
void dunpdef( char* why );
diff --git a/rsc/source/rscpp/cpp4.c b/rsc/source/rscpp/cpp4.c
index 034c0123816e..03f35604a562 100644..100755
--- a/rsc/source/rscpp/cpp4.c
+++ b/rsc/source/rscpp/cpp4.c
@@ -320,7 +320,7 @@ void doundef()
*/
void textput(char* text)
{
- int size;
+ size_t size;
size = strlen(text) + 1;
if ((parmp + size) >= &parm[NPARMWORK])
@@ -531,7 +531,7 @@ FILE_LOCAL void expstuff(DEFBUF* tokenp)
int c; /* Current character */
char* inp; /* -> repl string */
char* defp; /* -> macro output buff */
- int size; /* Actual parm. size */
+ size_t size; /* Actual parm. size */
char* defend; /* -> output buff end */
int string_magic; /* String formal hack */
FILEINFO* file; /* Funny #include */
diff --git a/rsc/source/rscpp/cpp6.c b/rsc/source/rscpp/cpp6.c
index 6905612dcf86..9444b720c80b 100644..100755
--- a/rsc/source/rscpp/cpp6.c
+++ b/rsc/source/rscpp/cpp6.c
@@ -485,7 +485,8 @@ char* savestring(char* text)
{
char* result;
- result = getmem(strlen(text) + 1);
+ size_t size = strlen(text) + 1;
+ result = getmem(size);
strcpy(result, text);
return (result);
}
@@ -493,10 +494,10 @@ char* savestring(char* text)
/*
* Common FILEINFO buffer initialization for a new file or macro.
*/
-FILEINFO* getfile(int bufsize, char* name)
+FILEINFO* getfile(size_t bufsize, char* name)
{
FILEINFO* file;
- int size;
+ size_t size;
size = strlen(name); /* File/macro name */
file = (FILEINFO*) getmem(sizeof (FILEINFO) + bufsize + size);
@@ -518,7 +519,7 @@ FILEINFO* getfile(int bufsize, char* name)
/*
* Get a block of free memory.
*/
-char* getmem(int size)
+char* getmem(size_t size)
{
char* result;