summaryrefslogtreecommitdiff
path: root/rsc
diff options
context:
space:
mode:
authorRohan Kumar <rohankanojia420@gmail.com>2016-03-07 22:56:00 +0530
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2016-03-12 14:24:42 +0000
commit0c3ff8ca07265304f9ea0a7aca8c83703cff01a1 (patch)
tree47f3268cebd9ade7c8afc8ff4d5aa199ee69849c /rsc
parentf3d454647ae5f0398ce3b38a71ed525bc16c3722 (diff)
tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals
I replaced OSL_DEBUG_LEVEL > 1 with OSL_DEBUG_LEVEL > 0 conditionals and in some places i used SAL_INFO(..)s Change-Id: I87e2e4d73be22630dbcce6df2650b924cba9f8ec Reviewed-on: https://gerrit.libreoffice.org/23005 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'rsc')
-rw-r--r--rsc/source/parser/rscdb.cxx11
-rw-r--r--rsc/source/prj/gui.cxx4
-rw-r--r--rsc/source/rsc/rsc.cxx12
-rw-r--r--rsc/source/rscpp/cpp.h10
-rw-r--r--rsc/source/rscpp/cpp1.c14
-rw-r--r--rsc/source/rscpp/cpp2.c6
-rw-r--r--rsc/source/rscpp/cpp3.c16
-rw-r--r--rsc/source/rscpp/cpp4.c12
-rw-r--r--rsc/source/rscpp/cpp6.c4
9 files changed, 37 insertions, 52 deletions
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index 2c253e8736c4..dbf0a54959e6 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -83,9 +83,6 @@ OString RscTypCont::ChangeLanguage(const OString& rNewLang)
if (bAppendEnUsFallback)
aFallbacks.push_back( "en-US");
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "RscTypCont::ChangeLanguage: " );
-#endif
aLangFallbacks.clear();
@@ -99,15 +96,11 @@ OString RscTypCont::ChangeLanguage(const OString& rNewLang)
AddLanguage( aLang.getStr() );
nID = GetLangId( aLang );
}
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, " '%s' (0x%hx) (%s)", aLang.getStr(), (int)nID, (bAdd ? "added" : "exists") );
-#endif
+ SAL_INFO("rsc", "RscTypCont::ChangeLanguage: " <<
+ "'" << aLang << "'" << " (0x" << std::hex << nID << ") (" << (bAdd ? "added" : "exists"));
aLangFallbacks.push_back( nID);
}
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "\n" );
-#endif
return aRet;
}
diff --git a/rsc/source/prj/gui.cxx b/rsc/source/prj/gui.cxx
index 3a0f0609ca19..f95f46988378 100644
--- a/rsc/source/prj/gui.cxx
+++ b/rsc/source/prj/gui.cxx
@@ -42,9 +42,7 @@ static RscVerbosity lcl_determineVerbosity( int argc, char ** argv )
int rsc2_main( int argc, char **argv )
{
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "debugging %s\n", argv[0] );
-#endif
+ SAL_WARN("rsc", "debugging " << argv[0]);
ERRTYPE aError;
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 6d663a220344..e4e9a830810a 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -96,9 +96,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
i = 1;
while( ppStr && i < (aCmdLine.GetCount() -1) )
{
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "CmdLineArg: \"%s\"\n", *ppStr );
-#endif
+ SAL_INFO("rsc", "CmdLineArg: \"" << *ppStr << "\"");
if (strcmp(*ppStr, "-isystem") == 0)
{
// ignore "-isystem" and following arg
@@ -775,9 +773,7 @@ bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
bFile = aFS.isRegular();
}
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "Searching image: %s\n", aSysPath.getStr() );
-#endif
+ SAL_INFO("rsc", "Searching image: " << aSysPath);
if( bFile )
{
@@ -812,9 +808,7 @@ bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
fprintf( pSysListFile, "%s\n", rContext.pCmdLine->substitutePaths( aSysPath ).getStr() );
}
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "ImagePath to add: %s\n", rImagePath.getStr() );
-#endif
+ SAL_INFO("rsc", "ImagePath to add: " << rImagePath);
}
++aDirIter;
diff --git a/rsc/source/rscpp/cpp.h b/rsc/source/rscpp/cpp.h
index 0114c2914c01..fb7ff4d10466 100644
--- a/rsc/source/rscpp/cpp.h
+++ b/rsc/source/rscpp/cpp.h
@@ -28,7 +28,7 @@
/* in cpp1.c: file-pointer auf stdout oder file */
extern FILE* pCppOut; /* BP */
#define PUTCHAR( d ) fprintf( pCppOut, "%c", (d) ) /* BP */
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
extern FILE* pDefOut; /* ER */
#ifdef EVALDEFS
#define NEVALBUF 2048
@@ -228,7 +228,7 @@ extern char* magic[]; /* Magic predefined symbols */
extern FILEINFO* infile; /* Current input file */
extern char work[NWORK + 1]; /* #define scratch */
extern char* workp; /* Free space in work */
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
extern int debug; /* Debug level */
/* ER dump & evaluate #define's */
extern int bDumpDefs; /* TRUE if #define's dump req. */
@@ -269,7 +269,7 @@ void InitCpp6( void );
void output( int c );
void sharp( void );
void cppmain( void );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
#ifdef EVALDEFS
int outputEval( int c );
#endif
@@ -300,7 +300,7 @@ int expcollect( void );
void expstuff( DEFBUF* dp );
void stparmscan( int delim );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
void dumpparm( char* why );
#endif
@@ -342,7 +342,7 @@ void cwarn( char* format, char* sarg );
void cfatal( char* format, char* sarg );
void cierror( char* format, int n );
void ciwarn( char* format, int n );
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
void dumpdef( char* why );
void dumpadef( char* why, DEFBUF *dp );
#endif
diff --git a/rsc/source/rscpp/cpp1.c b/rsc/source/rscpp/cpp1.c
index f277b6b05695..31097ae3a289 100644
--- a/rsc/source/rscpp/cpp1.c
+++ b/rsc/source/rscpp/cpp1.c
@@ -27,7 +27,7 @@
FILE* pCppOut = NULL;
FILE* pCppIn = NULL;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
FILE* pDefOut = NULL; /* ER evtl. #define's dump */
#endif
@@ -59,7 +59,7 @@ int wrongline; /* Force #line to compiler */
char token[IDMAX + 1]; /* Current input token */
int errors; /* cpp error counter */
FILEINFO* infile = NULL; /* Current input file */
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
int debug; /* TRUE if debugging now */
int bDumpDefs; /* TRUE if #define's dump req. */
#ifdef EVALDEFS
@@ -168,7 +168,7 @@ char* preset[] =
#ifdef COMPILER
COMPILER,
#endif
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
"decus_cpp", /* Ourselves! */
#endif
NULL /* Must be last */
@@ -211,7 +211,7 @@ void InitCpp1()
pCppOut = stdout;
pCppIn = stdin;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
debug = 0;
bDumpDefs = 0;
pDefOut = stdout;
@@ -260,7 +260,7 @@ int MAIN(int argc, char** argv)
}
switch (i)
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
case 4:
if ( bDumpDefs )
{
@@ -320,7 +320,7 @@ int MAIN(int argc, char** argv)
setincdirs(); /* Setup -I include directories */
addfile( pCppIn, work); /* "open" main input file */
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if (debug > 0 || bDumpDefs)
dumpdef("preset #define symbols");
#endif
@@ -333,7 +333,7 @@ int MAIN(int argc, char** argv)
{
cierror("Inside #ifdef block at end of input, depth = %d", i);
}
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if( pDefOut != stdout && pDefOut != stderr )
fclose( pDefOut );
#endif
diff --git a/rsc/source/rscpp/cpp2.c b/rsc/source/rscpp/cpp2.c
index 2108f099d83d..08613025b8c3 100644
--- a/rsc/source/rscpp/cpp2.c
+++ b/rsc/source/rscpp/cpp2.c
@@ -42,7 +42,7 @@
#define L_pragma ('p' + ('a' << 1))
#define L_undef ('u' + ('d' << 1))
#define L_error ('e' + ('r' << 1)) /* BP 5.3.92, #error */
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
#define L_debug ('d' + ('b' << 1)) /* #debug */
#define L_nodebug ('n' + ('d' << 1)) /* #nodebug */
#endif
@@ -89,7 +89,7 @@ int control(int counter)
case L_pragma: tp = "pragma"; break;
case L_undef: tp = "undef"; break;
case L_error: tp = "error"; break;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
case L_debug: tp = "debug"; break;
case L_nodebug: tp = "nodebug"; break;
#endif
@@ -258,7 +258,7 @@ int control(int counter)
unget();
break;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
case L_debug:
if (debug == 0)
dumpdef("debug set on");
diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c
index e836b3d22aa5..0512542290e7 100644
--- a/rsc/source/rscpp/cpp3.c
+++ b/rsc/source/rscpp/cpp3.c
@@ -28,7 +28,7 @@
#include <string.h>
-#if (OSL_DEBUG_LEVEL > 1) && (HOST == SYS_UNIX)
+#if (OSL_DEBUG_LEVEL > 0) && (HOST == SYS_UNIX)
#include <signal.h>
#endif
@@ -42,13 +42,13 @@ int openfile(char* filename)
if ((fp = fopen(filename, "r")) == NULL)
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if ( debug || !bDumpDefs )
perror(filename);
#endif
return (FALSE);
}
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if (debug)
fprintf(stderr, "Reading from \"%s\"\n", filename);
#endif
@@ -252,7 +252,7 @@ int dooptions(int argc, char** argv)
cwarn("\"%s\" wasn't defined", ap);
break;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
case 'X': /* Debug */
debug = (isdigit(*ap)) ? atoi(ap) : 1;
#if (HOST == SYS_UNIX)
@@ -262,7 +262,7 @@ int dooptions(int argc, char** argv)
break;
#endif
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
case 'P': /* #define's dump */
bDumpDefs = 1;
fprintf(stderr, "Dump #define's is on\n");
@@ -278,7 +278,7 @@ int dooptions(int argc, char** argv)
-N\t\t\tDon't predefine target-specific names\n\
-Stext\t\tSpecify sizes for #if sizeof\n\
-Usymbol\t\tUndefine symbol\n");
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
fprintf(stderr, " -Xvalue\t\tSet internal debug flag\n");
fprintf(stderr, " -P\t\t\tdump #define's\n");
#endif
@@ -286,7 +286,7 @@ int dooptions(int argc, char** argv)
} /* Switch on all options */
} /* If it's a -option */
} /* For all arguments */
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if ( (bDumpDefs ? j > 4 : j > 3) )
#else
if (j > 3)
@@ -316,7 +316,7 @@ int readoptions(char* filename, char*** pfargv)
filename++;
if ((fp = fopen(filename, "r")) == NULL)
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if ( debug || !bDumpDefs )
perror(filename);
#endif
diff --git a/rsc/source/rscpp/cpp4.c b/rsc/source/rscpp/cpp4.c
index eab7b15cefa4..f20843adfca3 100644
--- a/rsc/source/rscpp/cpp4.c
+++ b/rsc/source/rscpp/cpp4.c
@@ -200,7 +200,7 @@ void dodefine()
*workp = EOS; /* Terminate work */
dp->repl = savestring(work); /* Save the string */
dp->nargs = nargs; /* Save arg count */
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if (debug)
dumpadef("macro definition", dp);
else if (bDumpDefs)
@@ -372,7 +372,7 @@ void expand(DEFBUF* tokenp)
int c;
FILEINFO* file;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if (debug)
dumpadef("expand entry", tokenp);
#endif
@@ -452,7 +452,7 @@ void expand(DEFBUF* tokenp)
cwarn("Wrong number of macro arguments for \"%s\"",
tokenp->name);
}
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if (debug)
dumpparm("expand");
#endif
@@ -522,7 +522,7 @@ FILE_LOCAL int expcollect()
charput(c); /* Store this one */
} /* Collect an argument */
charput(EOS); /* Terminate argument */
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if (debug)
fprintf( pCppOut, "parm[%d] = \"%s\"\n", nargs, parlist[nargs - 1]);
#endif
@@ -598,13 +598,13 @@ FILE_LOCAL void expstuff(DEFBUF* tokenp)
}
}
*defp = EOS;
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if (debug > 1)
fprintf( pCppOut, "macroline: \"%s\"\n", file->buffer);
#endif
}
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
/*
* Dump parameter list.
diff --git a/rsc/source/rscpp/cpp6.c b/rsc/source/rscpp/cpp6.c
index 3678caa65378..4441255bdcd0 100644
--- a/rsc/source/rscpp/cpp6.c
+++ b/rsc/source/rscpp/cpp6.c
@@ -624,7 +624,7 @@ DEFBUF* defendel(char* name, int delete)
return dp;
}
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
void dumpdef(char* why)
{
@@ -798,7 +798,7 @@ int get()
{
if ((file->bptr = fgets(file->buffer, NBUFF, file->fp)) != NULL)
{
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
if (debug > 1) /* Dump it to stdout */
{
fprintf( pCppOut, "\n#line %d (%s), %s",