mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-15 17:31:56 +00:00
@@ -157,7 +157,7 @@ int main(int argc, char *argv[]) try {
|
|||||||
});
|
});
|
||||||
|
|
||||||
std::list<std::string> order_list;
|
std::list<std::string> order_list;
|
||||||
if (use_dict_list) {
|
if (use_dict_list != nullptr) {
|
||||||
for (auto &&x : bookname_to_ifo) {
|
for (auto &&x : bookname_to_ifo) {
|
||||||
gchar **p = get_impl(use_dict_list);
|
gchar **p = get_impl(use_dict_list);
|
||||||
for (; *p != nullptr; ++p)
|
for (; *p != nullptr; ++p)
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ bool DictInfo::load_from_ifo_file(const std::string& ifofilename,
|
|||||||
if (!g_str_has_prefix(
|
if (!g_str_has_prefix(
|
||||||
g_str_has_prefix(get_impl(buffer), (const gchar *)(utf8_bom)) ? get_impl(buffer) + 3 : get_impl(buffer),
|
g_str_has_prefix(get_impl(buffer), (const gchar *)(utf8_bom)) ? get_impl(buffer) + 3 : get_impl(buffer),
|
||||||
magic_data)) {
|
magic_data)) {
|
||||||
g_free(buffer);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,14 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
friend inline bool operator==(const ResourceWrapper& lhs, nullptr_t) noexcept {
|
||||||
|
return !lhs.p_;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend inline bool operator!=(const ResourceWrapper& lhs, nullptr_t) noexcept {
|
||||||
|
return !!lhs.p_;
|
||||||
|
}
|
||||||
|
|
||||||
friend inline T *get_impl(const ResourceWrapper& rw) {
|
friend inline T *get_impl(const ResourceWrapper& rw) {
|
||||||
return rw.p_;
|
return rw.p_;
|
||||||
}
|
}
|
||||||
@@ -39,21 +47,6 @@ private:
|
|||||||
T *p_;
|
T *p_;
|
||||||
|
|
||||||
void free_resource() { if (p_) unref_res(p_); }
|
void free_resource() { if (p_) unref_res(p_); }
|
||||||
|
|
||||||
// Helper for enabling 'if (sp)'
|
|
||||||
struct Tester {
|
|
||||||
Tester() {}
|
|
||||||
private:
|
|
||||||
void operator delete(void*);
|
|
||||||
};
|
|
||||||
public:
|
|
||||||
// enable 'if (sp)'
|
|
||||||
operator Tester*() const {
|
|
||||||
if (!*this)
|
|
||||||
return 0;
|
|
||||||
static Tester t;
|
|
||||||
return &t;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace glib {
|
namespace glib {
|
||||||
|
|||||||
Reference in New Issue
Block a user