From: thurston Date: Sun, 25 Mar 2007 22:46:35 +0000 (+0000) Subject: Some fixes which silence warnings emitted by the microsoft compiler. Adapted X-Git-Tag: 2.0_alpha~340 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a91ce9975298a5cb63332def99f1642a820b0728;p=external%2Fragel.git Some fixes which silence warnings emitted by the microsoft compiler. Adapted from patch by Josef Goettgens. git-svn-id: http://svn.complang.org/ragel/trunk@151 052ea7fc-9027-0410-9066-f65837a77df0 --- diff --git a/common/common.cpp b/common/common.cpp index 2faaef5..8a39727 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -253,7 +253,7 @@ char *findFileExtension( char *stemFile ) * replaces it with a new one. Returns a newed up string. */ char *fileNameFromStem( char *stemFile, char *suffix ) { - int len = strlen( stemFile ); + long len = strlen( stemFile ); assert( len > 0 ); /* Get the extension. */ diff --git a/common/config.h.in b/common/config.h.in index 813d0fa..0990bfc 100644 --- a/common/config.h.in +++ b/common/config.h.in @@ -31,8 +31,10 @@ #undef TXL #undef RUBY -#ifdef WIN32 +#ifdef _MSC_VER #define strcasecmp _stricmp +#define strtoll _strtoi64 +#pragma warning( disable: 4244 4250 4355 4800 ) #endif #endif /* _CONFIG_H */ diff --git a/ragel/fsmgraph.h b/ragel/fsmgraph.h index 3c58644..e59acc1 100644 --- a/ragel/fsmgraph.h +++ b/ragel/fsmgraph.h @@ -22,6 +22,7 @@ #ifndef _FSMGRAPH_H #define _FSMGRAPH_H +#include "config.h" #include #include #include "common.h" diff --git a/ragel/ragel.h b/ragel/ragel.h index 7264135..d7f652a 100644 --- a/ragel/ragel.h +++ b/ragel/ragel.h @@ -69,6 +69,6 @@ std::ostream &warning( const InputLoc &loc ); void terminateAllParsers( ); void writeMachines( std::ostream &out, std::string hostData, char *inputFileName ); -void xmlEscapeHost( std::ostream &out, char *data, int len ); +void xmlEscapeHost( std::ostream &out, char *data, long len ); #endif /* _RAGEL_H */ diff --git a/ragel/xmlcodegen.cpp b/ragel/xmlcodegen.cpp index 021c97e..28cf5e0 100644 --- a/ragel/xmlcodegen.cpp +++ b/ragel/xmlcodegen.cpp @@ -475,7 +475,7 @@ void XMLCodeGen::writeAction( Action *action ) out << "\n"; } -void xmlEscapeHost( std::ostream &out, char *data, int len ) +void xmlEscapeHost( std::ostream &out, char *data, long len ) { char *end = data + len; while ( data != end ) { diff --git a/redfsm/gendata.h b/redfsm/gendata.h index 855e071..4a6565d 100644 --- a/redfsm/gendata.h +++ b/redfsm/gendata.h @@ -23,6 +23,7 @@ #define _GENDATA_H #include +#include "config.h" #include "redfsm.h" #include "common.h" @@ -33,7 +34,6 @@ typedef DList ActionList; typedef unsigned long ulong; -struct FsmCodeGen; struct CodeGenData; typedef AvlMap CodeGenMap; diff --git a/redfsm/redfsm.h b/redfsm/redfsm.h index 515b1b6..f4e5792 100644 --- a/redfsm/redfsm.h +++ b/redfsm/redfsm.h @@ -25,6 +25,7 @@ #include #include #include +#include "config.h" #include "common.h" #include "vector.h" #include "dlist.h" diff --git a/rlgen-cd/rlgen-cd.h b/rlgen-cd/rlgen-cd.h index 93acd99..30fe11f 100644 --- a/rlgen-cd/rlgen-cd.h +++ b/rlgen-cd/rlgen-cd.h @@ -24,6 +24,7 @@ #include #include +#include "config.h" #include "avltree.h" #include "vector.h" #include "config.h" diff --git a/rlgen-dot/rlgen-dot.h b/rlgen-dot/rlgen-dot.h index 83152a5..258d4b4 100644 --- a/rlgen-dot/rlgen-dot.h +++ b/rlgen-dot/rlgen-dot.h @@ -24,6 +24,7 @@ #include #include +#include "config.h" #include "avltree.h" #include "vector.h" #include "config.h"