Skip to content

Commit

Permalink
[rmkit] make single file header work in impl/no-impl modes
Browse files Browse the repository at this point in the history
  • Loading branch information
okay committed Dec 13, 2024
1 parent 13290f6 commit 076ec18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/rmkit/ui/reflow.cpy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace ui:
class ReflowLayout: public ui::Layout:
public:
static unordered_map<Scene, vector<ReflowLayout*>> scene_to_layouts
static unordered_map<Scene, vector<ReflowLayout*>> scene_to_layouts = {}
vector<ReflowLayout*> layouts

class PackedChild:
Expand Down Expand Up @@ -75,7 +75,6 @@ namespace ui:
sl := ReflowLayout::add(w)
self.center.push_back({sl, NULL, padding})
;
unordered_map<Scene, vector<ReflowLayout*>> ReflowLayout::scene_to_layouts = {}

class HorizontalReflow: public ReflowLayout:
public:
Expand Down
8 changes: 4 additions & 4 deletions src/rmkit/util/lsdir.cpy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace util:

void sort_by_modified_date(vector<string> &filenames, string dirname):
static void sort_by_modified_date(vector<string> &filenames, string dirname):
struct stat buf
vector<tuple<int, string>> entries
for (auto filename : filenames)
Expand All @@ -14,16 +14,16 @@ namespace util:
if(stat(full_path.c_str(), &buf))
debug "Failed stat() on ", full_path
continue
entries.push_back({buf.st_mtime, filename})
entries.push_back({buf.st_mtime, filename})

sort(entries.begin(), entries.end())
filenames.clear()
for (auto e : entries)
filenames.push_back(std::get<1>(e))

reverse(filenames.begin(), filenames.end())

vector<string> lsdir(string dirname, string ext=""):
static vector<string> lsdir(string dirname, string ext=""):
DIR *dir
struct dirent *ent

Expand Down

0 comments on commit 076ec18

Please sign in to comment.