Skip to content

Commit

Permalink
Fix some compiler warning (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
faker2048 committed Jan 2, 2024
1 parent d77c20c commit 5714b0d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
8 changes: 4 additions & 4 deletions common/simple_dom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ static NodeImpl* parse_json(char* text, size_t size, int flags) {
Reader reader;
reader.Parse<flags>(stream(text), handler);
*/
return {nullptr};
return nullptr;
}

static NodeImpl* parse_xml(char* text, size_t size, int flags) {
return {nullptr};
return nullptr;
}

static NodeImpl* parse_yaml(char* text, size_t size, int flags) {
return {nullptr};
return nullptr;
}

static NodeImpl* parse_ini(char* text, size_t size, int flags) {
return {nullptr};
return nullptr;
}

Node parse(char* text, size_t size, int flags) {
Expand Down
5 changes: 2 additions & 3 deletions common/simple_dom_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ namespace SimpleDOM {

using str = estring_view;

struct Node;

// the interface for internal implementations
class NodeImpl : public Object {
protected:
NodeImpl() = default;
NodeImpl() = delete;
NodeImpl* _root;
union {
NodeImpl* _next;
Expand All @@ -60,7 +59,7 @@ union {
delete this;
}

friend struct Node;
friend class Node;

public:
virtual size_t num_children() const __attribute__((pure)) = 0;
Expand Down
16 changes: 8 additions & 8 deletions fs/subfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,56 +231,56 @@ namespace fs
return underlayfs->mknod(path, mode, dev);
}

virtual ssize_t getxattr(const char *path, const char *name, void *value, size_t size)
virtual ssize_t getxattr(const char *path, const char *name, void *value, size_t size) override
{
if (!underlay_xattrfs)
LOG_ERROR_RETURN(ENOTSUP, -1, "xattr is not supported by underlay fs");
PathCat __(this, path);
return underlay_xattrfs->getxattr(path, name, value, size);
}
virtual ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size)
virtual ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size) override
{
if (!underlay_xattrfs)
LOG_ERROR_RETURN(ENOTSUP, -1, "xattr is not supported by underlay fs");
PathCat __(this, path);
return underlay_xattrfs->lgetxattr(path, name, value, size);
}
virtual ssize_t listxattr(const char *path, char *list, size_t size)
virtual ssize_t listxattr(const char *path, char *list, size_t size) override
{
if (!underlay_xattrfs)
LOG_ERROR_RETURN(ENOTSUP, -1, "xattr is not supported by underlay fs");
PathCat __(this, path);
return underlay_xattrfs->listxattr(path, list, size);
}
virtual ssize_t llistxattr(const char *path, char *list, size_t size)
virtual ssize_t llistxattr(const char *path, char *list, size_t size) override
{
if (!underlay_xattrfs)
LOG_ERROR_RETURN(ENOTSUP, -1, "xattr is not supported by underlay fs");
PathCat __(this, path);
return underlay_xattrfs->llistxattr(path, list, size);
}
virtual int setxattr(const char *path, const char *name, const void *value, size_t size, int flags)
virtual int setxattr(const char *path, const char *name, const void *value, size_t size, int flags) override
{
if (!underlay_xattrfs)
LOG_ERROR_RETURN(ENOTSUP, -1, "xattr is not supported by underlay fs");
PathCat __(this, path);
return underlay_xattrfs->setxattr(path, name, value, size, flags);
}
virtual int lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags)
virtual int lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags) override
{
if (!underlay_xattrfs)
LOG_ERROR_RETURN(ENOTSUP, -1, "xattr is not supported by underlay fs");
PathCat __(this, path);
return underlay_xattrfs->lsetxattr(path, name, value, size, flags);
}
virtual int removexattr(const char *path, const char *name)
virtual int removexattr(const char *path, const char *name) override
{
if (!underlay_xattrfs)
LOG_ERROR_RETURN(ENOTSUP, -1, "xattr is not supported by underlay fs");
PathCat __(this, path);
return underlay_xattrfs->removexattr(path, name);
}
virtual int lremovexattr(const char *path, const char *name)
virtual int lremovexattr(const char *path, const char *name) override
{
if (!underlay_xattrfs)
LOG_ERROR_RETURN(ENOTSUP, -1, "xattr is not supported by underlay fs");
Expand Down

0 comments on commit 5714b0d

Please sign in to comment.