Found with [-Wconversion].
std::string strVal;
- const uint32_t val_len = val.size ();
+ const size_t val_len = val.size ();
if (val_len >= 2 && val[0] == val[val_len - 1]
&& (val[0] == '"' || val[0] == '\''))
{
{
if(!eof)
{
- uint32_t cnt;
+ ptrdiff_t cnt;
/* Do not get rid of anything when rFlag is active. Otherwise
* get rid of everything that was already handedout. */
if (!rFlag)
in_parse = new_in_parse;
}
-void Scanner::fatal_at(uint32_t line, uint32_t ofs, const char *msg) const
+void Scanner::fatal_at(uint32_t line, ptrdiff_t ofs, const char *msg) const
{
std::cerr << "re2c: error: "
<< "line " << line << ", column " << (tchar + ofs + 1) << ": "
exit(1);
}
-void Scanner::fatal(uint32_t ofs, const char *msg) const
+void Scanner::fatal(ptrdiff_t ofs, const char *msg) const
{
fatal_at(in_parse ? tline : cline, ofs, msg);
}
void Scanner::restore_state(const ScannerState& state)
{
- int diff = bot - state.bot;
+ ptrdiff_t diff = bot - state.bot;
char *old_bot = bot;
char *old_lim = lim;
char *old_top = top;
char * top;
char * eof;
- uint32_t tchar;
+ ptrdiff_t tchar;
uint32_t tline;
uint32_t cline;
uint32_t get_line() const;
const std::string & get_fname () const;
void set_in_parse(bool new_in_parse);
- void fatal_at(uint32_t line, uint32_t ofs, const char *msg) const;
+ void fatal_at(uint32_t line, ptrdiff_t ofs, const char *msg) const;
void fatalf_at(uint32_t line, const char*, ...) const RE2C_GXX_ATTRIBUTE ((format (printf, 3, 4)));
void fatalf(const char*, ...) const RE2C_GXX_ATTRIBUTE ((format (printf, 2, 3)));
void fatal(const char*) const;
- void fatal(uint32_t, const char*) const;
+ void fatal(ptrdiff_t, const char*) const;
void config(const std::string &, int);
void config(const std::string &, const std::string &);
#ifndef _RE2C_UTIL_SUBSTR_
#define _RE2C_UTIL_SUBSTR_
-#include "src/util/c99_stdint.h"
#include "src/util/forbid_copy.h"
namespace re2c
public:
const char * str;
const char * const org;
- uint32_t len;
+ size_t len;
- inline SubStr (const char * s, uint32_t l)
+ inline SubStr (const char * s, size_t l)
: str (s)
, org (s)
, len (l)
{}
- inline uint32_t ofs () const
+ inline ptrdiff_t ofs () const
{
return str - org;
}