More small windows int types fixes.
This commit is contained in:
parent
59ba8e9fce
commit
1b9673deb1
8 changed files with 29 additions and 21 deletions
|
@ -43,10 +43,15 @@ const int KB = 1024;
|
|||
// Process a plain text file
|
||||
bool MimeHandlerText::set_document_file(const string& mt, const string &fn)
|
||||
{
|
||||
LOGDEB(("MimeHandlerText::set_document_file: [%s]\n", fn.c_str()));
|
||||
LOGDEB(("MimeHandlerText::set_document_file: [%s] offs %lld\n",
|
||||
fn.c_str(), m_offs));
|
||||
|
||||
RecollFilter::set_document_file(mt, fn);
|
||||
|
||||
m_fn = fn;
|
||||
// This should not be necessary, but it happens on msw that offset is large
|
||||
// negative at this point, could not find the reason (still trying).
|
||||
m_offs = 0;
|
||||
|
||||
// file size for oversize check
|
||||
long long fsize = path_filesize(m_fn);
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include <sys/types.h>
|
||||
|
||||
#include <string>
|
||||
using std::string;
|
||||
|
||||
#include "mimehandler.h"
|
||||
|
||||
|
@ -30,22 +29,22 @@ using std::string;
|
|||
*/
|
||||
class MimeHandlerText : public RecollFilter {
|
||||
public:
|
||||
MimeHandlerText(RclConfig *cnf, const string& id)
|
||||
: RecollFilter(cnf, id), m_paging(false), m_offs(0)
|
||||
MimeHandlerText(RclConfig *cnf, const std::string& id)
|
||||
: RecollFilter(cnf, id), m_paging(false), m_offs(0), m_pagesz(0)
|
||||
{
|
||||
}
|
||||
virtual ~MimeHandlerText()
|
||||
{
|
||||
}
|
||||
virtual bool set_document_file(const string& mt, const string &file_path);
|
||||
virtual bool set_document_string(const string&, const string&);
|
||||
virtual bool set_document_file(const std::string& mt, const std::string &file_path);
|
||||
virtual bool set_document_string(const std::string&, const std::string&);
|
||||
virtual bool is_data_input_ok(DataInput input) const {
|
||||
if (input == DOCUMENT_FILE_NAME || input == DOCUMENT_STRING)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
virtual bool next_document();
|
||||
virtual bool skip_to_document(const string& s);
|
||||
virtual bool skip_to_document(const std::string& s);
|
||||
virtual void clear()
|
||||
{
|
||||
m_paging = false;
|
||||
|
@ -56,11 +55,11 @@ class MimeHandlerText : public RecollFilter {
|
|||
}
|
||||
private:
|
||||
bool m_paging;
|
||||
string m_text;
|
||||
string m_fn;
|
||||
std::string m_text;
|
||||
std::string m_fn;
|
||||
off_t m_offs; // Offset of next read in file if we're paging
|
||||
size_t m_pagesz;
|
||||
string m_charsetfromxattr;
|
||||
std::string m_charsetfromxattr;
|
||||
|
||||
bool readnext();
|
||||
};
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include UNORDERED_MAP_INCLUDE
|
||||
|
||||
using std::string;
|
||||
|
@ -14169,7 +14170,7 @@ int unacmaybefold_string_utf16(const char* in, size_t in_length,
|
|||
char** outp, size_t* out_lengthp, int what)
|
||||
{
|
||||
char* out;
|
||||
int out_size;
|
||||
size_t out_size;
|
||||
int out_length;
|
||||
unsigned int i;
|
||||
|
||||
|
@ -14189,7 +14190,7 @@ int unacmaybefold_string_utf16(const char* in, size_t in_length,
|
|||
for(i = 0; i < in_length; i += 2) {
|
||||
unsigned short c;
|
||||
unsigned short* p;
|
||||
int l;
|
||||
size_t l;
|
||||
int k;
|
||||
c = (in[i] << 8) | (in[i + 1] & 0xff);
|
||||
/*
|
||||
|
@ -14435,10 +14436,11 @@ static int convert(const char* from, const char* to,
|
|||
const char* tmp = space;
|
||||
size_t tmp_length = 2;
|
||||
if(iconv(cd, (ICONV_CONST char **) &tmp, &tmp_length, &out, &out_remain) == (size_t)-1) {
|
||||
if(errno == E2BIG)
|
||||
if(errno == E2BIG) {
|
||||
/* fall thru to the E2BIG case below */;
|
||||
else
|
||||
} else {
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
/* The offending character was replaced by a SPACE, skip it. */
|
||||
in += 2;
|
||||
|
@ -14454,7 +14456,7 @@ static int convert(const char* from, const char* to,
|
|||
/*
|
||||
* The output does not fit in the current out buffer, enlarge it.
|
||||
*/
|
||||
int length = out - out_base;
|
||||
size_t length = out - out_base;
|
||||
out_size *= 2;
|
||||
{
|
||||
char *saved = out_base;
|
||||
|
|
|
@ -125,7 +125,9 @@ static string idFileInternal(istream& input, const char *fn)
|
|||
// Except for a possible first line with 'From ', lines must
|
||||
// begin with whitespace or have a colon
|
||||
// (hope no one comes up with a longer header name !
|
||||
if (!isspace(cline[0])) {
|
||||
// Take care to convert to unsigned char because ms ctype does
|
||||
// like negative values
|
||||
if (!isspace((unsigned char)cline[0])) {
|
||||
char *cp = strchr(cline, ':');
|
||||
if (cp == 0 || (cp - cline) > 70) {
|
||||
LOGDEB2(("idfile: can't be mail header line: [%s]\n", cline));
|
||||
|
|
|
@ -520,7 +520,7 @@ bool path_isroot(const string& path)
|
|||
if (path.size() == 1 && path[0] == '/')
|
||||
return true;
|
||||
#ifdef _WIN32
|
||||
if (path.size == 3 && isalpha(path[0]) && path[1] == ':' && path[2] == '/')
|
||||
if (path.size() == 3 && isalpha(path[0]) && path[1] == ':' && path[2] == '/')
|
||||
return true;
|
||||
#endif
|
||||
return false;
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>BUILDING_RECOLL;__WIN32__;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>C:\Iconv\include;C:\xapian\xapian-core-1.2.8\include;C:\Users\Bill\recoll\src\internfile;C:\Users\Bill\recoll\src\rcldb;C:\Users\Bill\recoll\src\index;C:\Users\Bill\recoll\src\bincimapmime;C:\Users\Bill\recoll\src\unac;C:\Users\Bill\recoll\src\windows;C:\zlib\include;C:\pthreads-w32\Pre-built.2\include;C:\Users\Bill\recoll\src\xaposix;C:\Users\Bill\recoll\src\common;C:\Users\Bill\recoll\src\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\Iconv64\include;C:\xapian\xapian-core-1.2.8\include;C:\Users\Bill\recoll\src\internfile;C:\Users\Bill\recoll\src\rcldb;C:\Users\Bill\recoll\src\index;C:\Users\Bill\recoll\src\bincimapmime;C:\Users\Bill\recoll\src\unac;C:\Users\Bill\recoll\src\windows;C:\zlib\include;C:\pthreads-w32\Pre-built.2\include;C:\Users\Bill\recoll\src\xaposix;C:\Users\Bill\recoll\src\common;C:\Users\Bill\recoll\src\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4800;4996</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>C:\xapian\xapian-core-1.2.8\win32\x64\Debug;C:\Users\Bill\recoll\src\windows\x64\Debug;C:\pthreads-w32\Pre-built.2\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Win32ProjectRecoll.lib;C:\zlib64\zlib-win64\x64\Debug\zlib.lib;xapian-core.lib;C:\iconv64\Debug_x64\libiconvD.lib;Ws2_32.lib;Rpcrt4.lib;pthreadVC2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Win32ProjectRecoll.lib;C:\zlib64\zlib-win64\x64\Debug\zlib.lib;xapian-core.lib;C:\iconv64\libiconv\x64\Debug\libiconv.lib;Ws2_32.lib;Rpcrt4.lib;pthreadVC2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>C:\xapian\xapian-core-1.2.8\win32\x64\Debug;C:\Users\Bill\recoll\src\windows\x64\Debug;C:\pthreads-w32\Pre-built.2\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Win32ProjectRecoll.lib;C:\zlib64\zlib-win64\x64\Debug\zlib.lib;xapian-core.lib;C:\iconv64\Debug_x64\libiconvD.lib;Ws2_32.lib;Rpcrt4.lib;pthreadVC2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Win32ProjectRecoll.lib;C:\zlib64\zlib-win64\x64\Debug\zlib.lib;xapian-core.lib;C:\iconv64\libiconv\x64\Debug\libiconv.lib;Ws2_32.lib;Rpcrt4.lib;pthreadVC2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue