mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-15 17:31:56 +00:00
replace array with variable size with vector,
this should help clang compiler to compile our source code
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user