summaryrefslogtreecommitdiff
path: root/idlc
diff options
context:
space:
mode:
Diffstat (limited to 'idlc')
-rw-r--r--idlc/inc/idlc/idlctypes.hxx4
-rw-r--r--idlc/inc/idlc/options.hxx2
-rw-r--r--idlc/source/astexpression.cxx85
-rw-r--r--idlc/source/idlccompile.cxx5
-rw-r--r--idlc/source/options.cxx3
-rw-r--r--idlc/source/parser.y6
-rw-r--r--idlc/source/preproc/include.c9
-rw-r--r--idlc/source/preproc/lex.c2
-rw-r--r--idlc/source/preproc/macro.c7
-rw-r--r--idlc/source/preproc/tokens.c2
-rw-r--r--idlc/source/preproc/unix.c2
11 files changed, 70 insertions, 57 deletions
diff --git a/idlc/inc/idlc/idlctypes.hxx b/idlc/inc/idlc/idlctypes.hxx
index 0849dd85fb28..3b7b1d5e3db5 100644
--- a/idlc/inc/idlc/idlctypes.hxx
+++ b/idlc/inc/idlc/idlctypes.hxx
@@ -30,7 +30,7 @@
#include <stdio.h>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <list>
#include <vector>
#include <set>
@@ -73,7 +73,7 @@ typedef ::std::list< AstUnionLabel* > LabelList;
class AstDeclaration;
-typedef ::std::hash_map< ::rtl::OString, AstDeclaration*, HashString, EqualString > DeclMap;
+typedef ::boost::unordered_map< ::rtl::OString, AstDeclaration*, HashString, EqualString > DeclMap;
typedef ::std::list< AstDeclaration* > DeclList;
class AstScope;
diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx
index 796552aec671..f319c082cc42 100644
--- a/idlc/inc/idlc/options.hxx
+++ b/idlc/inc/idlc/options.hxx
@@ -31,7 +31,7 @@
#include <idlc/idlctypes.hxx>
-typedef ::std::hash_map< ::rtl::OString,
+typedef ::boost::unordered_map< ::rtl::OString,
::rtl::OString,
HashString,
EqualString > OptionMap;
diff --git a/idlc/source/astexpression.cxx b/idlc/source/astexpression.cxx
index 394bb848bdd1..a96857f9256e 100644
--- a/idlc/source/astexpression.cxx
+++ b/idlc/source/astexpression.cxx
@@ -800,82 +800,105 @@ void AstExpression::evaluate(EvalKind ek)
sal_Bool AstExpression::operator==(AstExpression *pExpr)
{
+ sal_Bool bRet = sal_False;
if (m_combOperator != pExpr->getCombOperator())
- return sal_False;
+ return bRet;
evaluate(EK_const);
pExpr->evaluate(EK_const);
if (m_exprValue == NULL || pExpr->getExprValue() == NULL)
- return sal_False;
+ return bRet;
if (m_exprValue->et != pExpr->getExprValue()->et)
- return sal_False;
+ return bRet;
switch (m_exprValue->et)
{
case ET_short:
- return (m_exprValue->u.sval == pExpr->getExprValue()->u.sval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.sval == pExpr->getExprValue()->u.sval) ? sal_True : sal_False;
+ break;
case ET_ushort:
- return (m_exprValue->u.usval == pExpr->getExprValue()->u.usval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.usval == pExpr->getExprValue()->u.usval) ? sal_True : sal_False;
+ break;
case ET_long:
- return (m_exprValue->u.lval == pExpr->getExprValue()->u.lval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.lval == pExpr->getExprValue()->u.lval) ? sal_True : sal_False;
+ break;
case ET_ulong:
- return (m_exprValue->u.ulval == pExpr->getExprValue()->u.ulval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.ulval == pExpr->getExprValue()->u.ulval) ? sal_True : sal_False;
+ break;
case ET_hyper:
- return (m_exprValue->u.hval == pExpr->getExprValue()->u.hval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.hval == pExpr->getExprValue()->u.hval) ? sal_True : sal_False;
+ break;
case ET_uhyper:
- return (m_exprValue->u.uhval == pExpr->getExprValue()->u.uhval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.uhval == pExpr->getExprValue()->u.uhval) ? sal_True : sal_False;
+ break;
case ET_float:
- return (m_exprValue->u.fval == pExpr->getExprValue()->u.fval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.fval == pExpr->getExprValue()->u.fval) ? sal_True : sal_False;
+ break;
case ET_double:
- return (m_exprValue->u.dval == pExpr->getExprValue()->u.dval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.dval == pExpr->getExprValue()->u.dval) ? sal_True : sal_False;
+ break;
case ET_byte:
- return (m_exprValue->u.byval == pExpr->getExprValue()->u.byval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.byval == pExpr->getExprValue()->u.byval) ? sal_True : sal_False;
+ break;
case ET_boolean:
- return (m_exprValue->u.lval == pExpr->getExprValue()->u.lval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.lval == pExpr->getExprValue()->u.lval) ? sal_True : sal_False;
+ break;
default:
OSL_ASSERT(false);
- return sal_False;
+ bRet = sal_False;
+ break;
}
- return sal_False;
+ return bRet;
}
sal_Bool AstExpression::compare(AstExpression *pExpr)
{
+ bool bRet = sal_False;
if (m_combOperator != pExpr->getCombOperator())
- return sal_False;
+ return bRet;
evaluate(EK_const);
pExpr->evaluate(EK_const);
if (m_exprValue == NULL || pExpr->getExprValue() == NULL)
- return sal_False;
+ return bRet;
if (m_exprValue->et != pExpr->getExprValue()->et)
- return sal_False;
+ return bRet;
switch (m_exprValue->et)
{
case ET_short:
- return (m_exprValue->u.sval == pExpr->getExprValue()->u.sval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.sval == pExpr->getExprValue()->u.sval) ? sal_True : sal_False;
+ break;
case ET_ushort:
- return (m_exprValue->u.usval == pExpr->getExprValue()->u.usval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.usval == pExpr->getExprValue()->u.usval) ? sal_True : sal_False;
+ break;
case ET_long:
- return (m_exprValue->u.lval == pExpr->getExprValue()->u.lval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.lval == pExpr->getExprValue()->u.lval) ? sal_True : sal_False;
+ break;
case ET_ulong:
- return (m_exprValue->u.ulval == pExpr->getExprValue()->u.ulval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.ulval == pExpr->getExprValue()->u.ulval) ? sal_True : sal_False;
+ break;
case ET_hyper:
- return (m_exprValue->u.hval == pExpr->getExprValue()->u.hval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.hval == pExpr->getExprValue()->u.hval) ? sal_True : sal_False;
+ break;
case ET_uhyper:
- return (m_exprValue->u.uhval == pExpr->getExprValue()->u.uhval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.uhval == pExpr->getExprValue()->u.uhval) ? sal_True : sal_False;
+ break;
case ET_float:
- return (m_exprValue->u.fval == pExpr->getExprValue()->u.fval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.fval == pExpr->getExprValue()->u.fval) ? sal_True : sal_False;
+ break;
case ET_double:
- return (m_exprValue->u.dval == pExpr->getExprValue()->u.dval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.dval == pExpr->getExprValue()->u.dval) ? sal_True : sal_False;
+ break;
case ET_byte:
- return (m_exprValue->u.byval == pExpr->getExprValue()->u.byval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.byval == pExpr->getExprValue()->u.byval) ? sal_True : sal_False;
+ break;
case ET_boolean:
- return (m_exprValue->u.lval == pExpr->getExprValue()->u.lval) ? sal_True : sal_False;
+ bRet = (m_exprValue->u.lval == pExpr->getExprValue()->u.lval) ? sal_True : sal_False;
+ break;
default:
OSL_ASSERT(false);
- return sal_False;
+ bRet = sal_False;
+ break;
}
-
- return sal_False;
+ return bRet;
}
void AstExpression::fillDefinitionDetails()
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index 48c975b280a9..9bc69b148f1c 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -41,9 +41,10 @@
#endif
#ifdef SAL_UNX
+#include <errno.h>
#include <unistd.h>
#if defined(MACOSX) || defined(FREEBSD) || defined(NETBSD) || \
- defined(AIX) || defined(OPENBSD)
+ defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY)
#include <sys/wait.h>
#else
#include <wait.h>
@@ -168,7 +169,7 @@ OString makeTempName(const OString& prefix)
int nDescriptor = mkstemp(tmpFilePattern);
if( -1 == nDescriptor )
{
- fprintf( stderr,"idlc: couldn't create temporary file\n" );
+ fprintf(stderr, "idlc: mkstemp(\"%s\") failed: %s\n", tmpFilePattern, strerror(errno));
exit( 1 );
}
// the file shall later be reopened by stdio functions
diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx
index fe02e3a6e169..36f6880460c0 100644
--- a/idlc/source/options.cxx
+++ b/idlc/source/options.cxx
@@ -33,8 +33,7 @@
#include /*MSVC trouble: <cstring>*/ <string.h>
#include <idlc/options.hxx>
-using namespace rtl;
-
+using ::rtl::OString;
Options::Options(): m_stdin(false), m_verbose(false), m_quiet(false)
{
}
diff --git a/idlc/source/parser.y b/idlc/source/parser.y
index 6de66aee9b17..38e54382c15d 100644
--- a/idlc/source/parser.y
+++ b/idlc/source/parser.y
@@ -104,11 +104,15 @@
#include <algorithm>
#include <vector>
-using namespace rtl;
#define YYDEBUG 1
#define YYERROR_VERBOSE 1
+using ::rtl::OUString;
+using ::rtl::OString;
+using ::rtl::OStringToOUString;
+using ::rtl::OStringBuffer;
+
extern int yylex(void);
void yyerror(char const *);
diff --git a/idlc/source/preproc/include.c b/idlc/source/preproc/include.c
index b56622b571ee..e00156b13bcb 100644
--- a/idlc/source/preproc/include.c
+++ b/idlc/source/preproc/include.c
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__))
+#if (defined(_WIN32) || defined(__IBMC__))
# include <io.h>
#else
# include <unistd.h>
@@ -37,13 +37,6 @@
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
-
-#ifdef __hpux
-# define _HPUX_SOURCE
-#endif
-#ifdef SCO
-#define _IBCS2
-#endif
#include <limits.h>
#include "cpp.h"
diff --git a/idlc/source/preproc/lex.c b/idlc/source/preproc/lex.c
index 4b565b9c133f..7e1892a169dd 100644
--- a/idlc/source/preproc/lex.c
+++ b/idlc/source/preproc/lex.c
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__))
+#if (defined(_WIN32) || defined(__IBMC__))
#include <io.h>
#else
#include <unistd.h>
diff --git a/idlc/source/preproc/macro.c b/idlc/source/preproc/macro.c
index 35dc20d5204f..e30459958564 100644
--- a/idlc/source/preproc/macro.c
+++ b/idlc/source/preproc/macro.c
@@ -31,13 +31,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
-#ifdef __hpux
-# define _HPUX_SOURCE
-#endif
-#ifdef SCO
-# define _IBCS2
-#endif
#include <limits.h>
#include "cpp.h"
diff --git a/idlc/source/preproc/tokens.c b/idlc/source/preproc/tokens.c
index e119fc5cc2b8..b554226f9cf4 100644
--- a/idlc/source/preproc/tokens.c
+++ b/idlc/source/preproc/tokens.c
@@ -29,7 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__))
+#if (defined(_WIN32) || defined(__IBMC__))
#include <io.h>
#else
#include <unistd.h>
diff --git a/idlc/source/preproc/unix.c b/idlc/source/preproc/unix.c
index 57b49a74128a..56a97b973d98 100644
--- a/idlc/source/preproc/unix.c
+++ b/idlc/source/preproc/unix.c
@@ -31,7 +31,7 @@
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
-#if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__))
+#if (defined(_WIN32) || defined(__IBMC__))
#include <io.h>
#include <sys/stat.h>
#include <external/glibc/getopt.h>