mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-23 16:52:02 +00:00
Replace the magic value 1000 with a const variable
* src/support/unicode.C (iconv_convert): replace 1000 by const outsize. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15264 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f2ca75b3ac
commit
99fc6935a5
@ -64,9 +64,10 @@ iconv_convert(iconv_t * cd,
|
|||||||
|
|
||||||
char ICONV_CONST * inbuf = const_cast<char ICONV_CONST *>(reinterpret_cast<char const *>(buf));
|
char ICONV_CONST * inbuf = const_cast<char ICONV_CONST *>(reinterpret_cast<char const *>(buf));
|
||||||
size_t inbytesleft = buflen * sizeof(InType);
|
size_t inbytesleft = buflen * sizeof(InType);
|
||||||
static char out[1000];
|
size_t const outsize = 1000;
|
||||||
|
static char out[outsize];
|
||||||
char * outbuf = out;
|
char * outbuf = out;
|
||||||
size_t outbytesleft = 1000;
|
size_t outbytesleft = outsize;
|
||||||
|
|
||||||
size_t res = iconv(*cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
|
size_t res = iconv(*cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
|
||||||
|
|
||||||
@ -115,7 +116,7 @@ iconv_convert(iconv_t * cd,
|
|||||||
//lyxerr << std::dec;
|
//lyxerr << std::dec;
|
||||||
//lyxerr << "Inbytesleft: " << inbytesleft << endl;
|
//lyxerr << "Inbytesleft: " << inbytesleft << endl;
|
||||||
//lyxerr << "Outbytesleft: " << outbytesleft << endl;
|
//lyxerr << "Outbytesleft: " << outbytesleft << endl;
|
||||||
int bytes = 1000 - outbytesleft;
|
int bytes = outsize - outbytesleft;
|
||||||
|
|
||||||
RetType const * tmp = reinterpret_cast<RetType const *>(out);
|
RetType const * tmp = reinterpret_cast<RetType const *>(out);
|
||||||
return std::vector<RetType>(tmp, tmp + bytes / sizeof(RetType));
|
return std::vector<RetType>(tmp, tmp + bytes / sizeof(RetType));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user