Merge pull request #64 from Dushistov/to-release

To release
This commit is contained in:
Evgeniy Dushistov
2020-08-14 12:56:08 +03:00
committed by GitHub
7 changed files with 22 additions and 30 deletions

View File

@@ -1,24 +1,14 @@
project(sdcv)
# Older versions have a different signature for CMAKE_MINIMUM_REQUIRED,
# check it manually just to make sure
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
message(FATAL_ERROR "${PROJECT_NAME} requires at least CMake v2.8."
" You are running v${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}."
" Please upgrade." )
endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
# If we get this far, use the modern signature. This will also cause newer
# CMake versions to try to be backwards-compatible with the desired version
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_policy(VERSION 2.8)
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_policy(VERSION 3.5)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/compiler.cmake")
set(ZLIB_FIND_REQUIRED True)
include(FindZLIB)
set(GLIB2_REQ "'glib-2.0 >= 2.6.1'")
set(GLIB2_REQ "'glib-2.0 >= 2.36'")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindGLIB2.cmake")

View File

@@ -314,7 +314,7 @@ public:
private:
FILE *output;
};
}
} // namespace
search_result Library::process_phrase(const char *loc_str, IReadLine &io, bool force)
{

View File

@@ -57,7 +57,7 @@ public:
return stdio_getline(stdin, line);
}
};
}
} // namespace
#else
namespace
@@ -116,7 +116,7 @@ public:
add_history(phrase.c_str());
}
};
}
} // namespace
#endif //WITH_READLINE
IReadLine *create_readline_object()

View File

@@ -53,7 +53,7 @@ static void free_str_array(gchar **arr)
g_free(*p);
g_free(arr);
}
}
} // namespace
namespace glib
{
using StrArr = ResourceWrapper<gchar *, gchar *, free_str_array>;
@@ -61,7 +61,8 @@ using StrArr = ResourceWrapper<gchar *, gchar *, free_str_array>;
static void list_dicts(const std::list<std::string> &dicts_dir_list, bool use_json);
int main(int argc, char *argv[]) try {
int main(int argc, char *argv[])
try {
setlocale(LC_ALL, "");
#if ENABLE_NLS
bindtextdomain("sdcv",

View File

@@ -71,7 +71,7 @@ static void unicode_strdown(gunichar *str)
++str;
}
}
}
} // namespace
bool DictInfo::load_from_ifo_file(const std::string &ifofilename,
bool istreedict)
@@ -334,6 +334,7 @@ bool DictBase::SearchData(std::vector<std::string> &SearchWords, guint32 idxitem
if (dictfile)
fseek(dictfile, idxitem_offset, SEEK_SET);
THROW_IF_ERROR(origin_data != nullptr);
if (dictfile) {
const size_t nitems = fread(origin_data, idxitem_size, 1, dictfile);
THROW_IF_ERROR(nitems == 1);
@@ -758,7 +759,7 @@ bool OffsetIndex::lookup(const char *str, glong &idx)
return bFound;
}
bool WordListIndex::load(const std::string &url, gulong wc, gulong fsize, bool verbose)
bool WordListIndex::load(const std::string &url, gulong wc, gulong fsize, bool)
{
gzFile in = gzopen(url.c_str(), "rb");
if (in == nullptr)
@@ -826,7 +827,7 @@ bool WordListIndex::lookup(const char *str, glong &idx)
}
return bFound;
}
}
} // namespace
bool SynFile::load(const std::string &url, gulong wc)
{

View File

@@ -68,7 +68,7 @@ namespace glib
{
typedef ResourceWrapper<gchar, void, g_free> CharStr;
typedef ResourceWrapper<GError, GError, g_error_free> Error;
}
} // namespace glib
extern std::string utf8_to_locale_ign_err(const std::string &utf8_str);