replace array with variable size with vector,

this should help clang compiler to compile our source code
This commit is contained in:
Evgeniy Dushistov
2013-07-06 12:52:48 +00:00
parent 2a5da7969f
commit ab22f8eb41
5 changed files with 7 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ void for_each_file(const List& dirs_list, const std::string& suff,
List::const_iterator it;
for (it=order_list.begin(); it!=order_list.end(); ++it) {
bool disable=std::find(disable_list.begin(), disable_list.end(),
*it)!=disable_list.end();
*it)!=disable_list.end();
f(*it, disable);
}
for (it=dirs_list.begin(); it!=dirs_list.end(); ++it)

View File

@@ -750,12 +750,12 @@ bool wordlist_index::load(const std::string& url, gulong wc, gulong fsize)
idxdatabuf = (gchar *)g_malloc(fsize);
gulong len = gzread(in, idxdatabuf, fsize);
const int len = gzread(in, idxdatabuf, fsize);
gzclose(in);
if (len < 0)
return false;
if (len != fsize)
if (gulong(len) != fsize)
return false;
wordlist.resize(wc+1);

View File

@@ -119,7 +119,7 @@ public:
glong narticles(int idict) { return oLib[idict]->narticles(); }
const std::string& dict_name(int idict) { return oLib[idict]->dict_name(); }
gint ndicts() { return oLib.size(); }
gint ndicts() const { return oLib.size(); }
const gchar * poGetWord(glong iIndex,int iLib) {
return oLib[iLib]->get_key(iIndex);

View File

@@ -209,8 +209,8 @@ void Library::LookupWithRule(const string &str, TSearchResultList& res_list)
void Library::LookupData(const string &str, TSearchResultList& res_list)
{
std::vector<gchar *> drl[ndicts()];
if (!Libs::LookupData(str.c_str(), drl))
std::vector<std::vector<gchar *> > drl(ndicts());
if (!Libs::LookupData(str.c_str(), &drl[0]))
return;
for (int idict=0; idict<ndicts(); ++idict)
for (std::vector<gchar *>::size_type j=0; j<drl[idict].size(); ++j) {

View File

@@ -16,7 +16,7 @@ for i in `../src/sdcv --utf8-input -n человек 2>&1`; do
done
if [ $j -eq 1 ]; then
echo "empty results of search: test failed" >&2
echo "$0: empty results of search: test failed" >&2
exit 1
fi