64 bits fixes
This commit is contained in:
parent
a448a0b452
commit
9de619bd1b
@ -5,7 +5,7 @@ all: $(PROGS)
|
|||||||
XADUMP_OBJS= xadump.o $(BIGLIB)
|
XADUMP_OBJS= xadump.o $(BIGLIB)
|
||||||
xadump : $(XADUMP_OBJS)
|
xadump : $(XADUMP_OBJS)
|
||||||
$(CXX) $(CXXFLAGS) -o xadump $(XADUMP_OBJS) \
|
$(CXX) $(CXXFLAGS) -o xadump $(XADUMP_OBJS) \
|
||||||
$(LIBICONV) $(LIBXAPIAN)
|
$(LIBICONV) $(LIBXAPIAN) $(LIBSYS)
|
||||||
|
|
||||||
QXTRY_OBJS= qxtry.o $(BIGLIB)
|
QXTRY_OBJS= qxtry.o $(BIGLIB)
|
||||||
qxtry : $(QXTRY_OBJS)
|
qxtry : $(QXTRY_OBJS)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: xadump.cpp,v 1.6 2005-11-24 18:21:55 dockes Exp $ (C) 2004 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: xadump.cpp,v 1.7 2005-12-16 10:08:07 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
#include <signal.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
@ -12815,9 +12815,9 @@ int unac_string(const char* charset,
|
|||||||
*out_lengthp = 0;
|
*out_lengthp = 0;
|
||||||
} else {
|
} else {
|
||||||
char* utf16 = 0;
|
char* utf16 = 0;
|
||||||
int utf16_length = 0;
|
size_t utf16_length = 0;
|
||||||
char* utf16_unaccented = 0;
|
char* utf16_unaccented = 0;
|
||||||
int utf16_unaccented_length = 0;
|
size_t utf16_unaccented_length = 0;
|
||||||
|
|
||||||
if(convert(charset, utf16be(), in, in_length, &utf16, &utf16_length) < 0) {
|
if(convert(charset, utf16be(), in, in_length, &utf16, &utf16_length) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.8 2005-11-24 07:16:16 dockes Exp $ (C) 2004 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.9 2005-12-16 10:08:08 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TEST_MIMEPARSE
|
#ifndef TEST_MIMEPARSE
|
||||||
@ -38,7 +38,8 @@ class Lexical {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Skip mime comment. This must be called with in[start] == '('
|
// Skip mime comment. This must be called with in[start] == '('
|
||||||
int skip_comment(const string &in, unsigned int start, Lexical &lex)
|
string::size_type skip_comment(const string &in, string::size_type start,
|
||||||
|
Lexical &lex)
|
||||||
{
|
{
|
||||||
int commentlevel = 0;
|
int commentlevel = 0;
|
||||||
for (; start < in.size(); start++) {
|
for (; start < in.size(); start++) {
|
||||||
@ -67,8 +68,9 @@ int skip_comment(const string &in, unsigned int start, Lexical &lex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Skip initial whitespace and (possibly nested) comments.
|
// Skip initial whitespace and (possibly nested) comments.
|
||||||
int skip_whitespace_and_comment(const string &in, unsigned int start,
|
string::size_type skip_whitespace_and_comment(const string &in,
|
||||||
Lexical &lex)
|
string::size_type start,
|
||||||
|
Lexical &lex)
|
||||||
{
|
{
|
||||||
while (1) {
|
while (1) {
|
||||||
if ((start = in.find_first_not_of(" \t\r\n", start)) == string::npos)
|
if ((start = in.find_first_not_of(" \t\r\n", start)) == string::npos)
|
||||||
@ -90,8 +92,8 @@ int skip_whitespace_and_comment(const string &in, unsigned int start,
|
|||||||
/// @param start the starting position
|
/// @param start the starting position
|
||||||
/// @param lex the returned token and its description
|
/// @param lex the returned token and its description
|
||||||
/// @param delims separators we should look for
|
/// @param delims separators we should look for
|
||||||
int find_next_token(const string &in, unsigned int start,
|
string::size_type find_next_token(const string &in, string::size_type start,
|
||||||
Lexical &lex, string delims = ";=")
|
Lexical &lex, string delims = ";=")
|
||||||
{
|
{
|
||||||
char oquot, cquot;
|
char oquot, cquot;
|
||||||
|
|
||||||
@ -100,7 +102,7 @@ int find_next_token(const string &in, unsigned int start,
|
|||||||
return start;
|
return start;
|
||||||
|
|
||||||
// Begins with separator ? return it.
|
// Begins with separator ? return it.
|
||||||
unsigned int delimi = delims.find_first_of(in[start]);
|
string::size_type delimi = delims.find_first_of(in[start]);
|
||||||
if (delimi != string::npos) {
|
if (delimi != string::npos) {
|
||||||
lex.what = Lexical::separator;
|
lex.what = Lexical::separator;
|
||||||
lex.value = delims[delimi];
|
lex.value = delims[delimi];
|
||||||
@ -117,7 +119,7 @@ int find_next_token(const string &in, unsigned int start,
|
|||||||
|
|
||||||
if (cquot != 0) {
|
if (cquot != 0) {
|
||||||
// Quoted string parsing
|
// Quoted string parsing
|
||||||
unsigned int end;
|
string::size_type end;
|
||||||
start++; // Skip quote character
|
start++; // Skip quote character
|
||||||
for (end = start;end < in.size() && in[end] != cquot; end++) {
|
for (end = start;end < in.size() && in[end] != cquot; end++) {
|
||||||
if (in[end] == '\\') {
|
if (in[end] == '\\') {
|
||||||
@ -141,7 +143,7 @@ int find_next_token(const string &in, unsigned int start,
|
|||||||
lex.quote = oquot;
|
lex.quote = oquot;
|
||||||
return ++end;
|
return ++end;
|
||||||
} else {
|
} else {
|
||||||
unsigned int end = in.find_first_of(delims + " \t(", start);
|
string::size_type end = in.find_first_of(delims + " \t(", start);
|
||||||
lex.what = Lexical::token;
|
lex.what = Lexical::token;
|
||||||
lex.quote = 0;
|
lex.quote = 0;
|
||||||
if (end == string::npos) {
|
if (end == string::npos) {
|
||||||
@ -156,7 +158,7 @@ int find_next_token(const string &in, unsigned int start,
|
|||||||
|
|
||||||
void stringtolower(string &out, const string& in)
|
void stringtolower(string &out, const string& in)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < in.size(); i++)
|
for (string::size_type i = 0; i < in.size(); i++)
|
||||||
out.append(1, char(tolower(in[i])));
|
out.append(1, char(tolower(in[i])));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +168,7 @@ bool parseMimeHeaderValue(const string& value, MimeHeaderValue& parsed)
|
|||||||
parsed.params.clear();
|
parsed.params.clear();
|
||||||
|
|
||||||
Lexical lex;
|
Lexical lex;
|
||||||
unsigned int start = 0;
|
string::size_type start = 0;
|
||||||
start = find_next_token(value, start, lex);
|
start = find_next_token(value, start, lex);
|
||||||
if (start == string::npos || lex.what != Lexical::token)
|
if (start == string::npos || lex.what != Lexical::token)
|
||||||
return false;
|
return false;
|
||||||
@ -205,7 +207,7 @@ bool parseMimeHeaderValue(const string& value, MimeHeaderValue& parsed)
|
|||||||
bool qp_decode(const string& in, string &out)
|
bool qp_decode(const string& in, string &out)
|
||||||
{
|
{
|
||||||
out.reserve(in.length());
|
out.reserve(in.length());
|
||||||
unsigned int ii;
|
string::size_type ii;
|
||||||
for (ii = 0; ii < in.length(); ii++) {
|
for (ii = 0; ii < in.length(); ii++) {
|
||||||
if (in[ii] == '=') {
|
if (in[ii] == '=') {
|
||||||
ii++; // Skip '='
|
ii++; // Skip '='
|
||||||
@ -300,7 +302,7 @@ bool rfc2047_decode(const std::string& in, std::string &out)
|
|||||||
|
|
||||||
out = "";
|
out = "";
|
||||||
|
|
||||||
for (unsigned int ii = 0; ii < in.length(); ii++) {
|
for (string::size_type ii = 0; ii < in.length(); ii++) {
|
||||||
char ch = in[ii];
|
char ch = in[ii];
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case rfc2047base:
|
case rfc2047base:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user