Skip to content

Commit

Permalink
meta: Prefer MARK: over the old style of separator.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Apr 12, 2024
1 parent 38fd964 commit c5639ae
Show file tree
Hide file tree
Showing 86 changed files with 343 additions and 343 deletions.
4 changes: 2 additions & 2 deletions src/apps/hideo-base/dialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Hideo {

/* --- Dialogs Scaffolding -------------------------------------------------- */
// MARK: Dialogs Scaffolding ---------------------------------------------------

Ui::Child dialogScafold(Layout::Align a, Ui::Child inner) {
Ui::BoxStyle const boxStyle = {
Expand Down Expand Up @@ -45,7 +45,7 @@ Ui::Child dialogCloseButton() {
);
}

/* --- Dialogs -------------------------------------------------------------- */
// MARK: Dialogs ---------------------------------------------------------------

Ui::Child versionBadge() {
Ui::Children badges = {};
Expand Down
4 changes: 2 additions & 2 deletions src/apps/hideo-base/dialogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enum struct DialogButton {

FlagsEnum$(DialogButton);

/* --- Dialogs Scaffolding -------------------------------------------------- */
// MARK: Dialogs Scaffolding ---------------------------------------------------

Ui::Child dialogScafold(Layout::Align a, Ui::Child inner);

Expand All @@ -44,7 +44,7 @@ Ui::Child dialogButtons(DialogButton buttons, DialogButton primary);

Ui::Child dialogCloseButton();

/* --- Dialogs -------------------------------------------------------------- */
// MARK: Dialogs ---------------------------------------------------------------

Ui::Child licenseDialog();

Expand Down
4 changes: 2 additions & 2 deletions src/apps/hideo-files/widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Hideo::Files {

/* --- Common Widgets ------------------------------------------------------- */
// MARK: Common Widgets --------------------------------------------------------

Ui::Child alert(State const &state, String title, String body) {
return Ui::vflow(
Expand Down Expand Up @@ -203,7 +203,7 @@ Ui::Child toolbar(State const &state) {
);
}

/* --- Dialogs ------------------------------------------------------------ */
// MARK: Dialogs -------------------------------------------------------------

Ui::Child openFileDialog() {
return Ui::reducer<Model>(
Expand Down
4 changes: 2 additions & 2 deletions src/apps/hideo-files/widgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Hideo::Files {

/* --- Common Widgets ------------------------------------------------------- */
// MARK: Common Widgets --------------------------------------------------------

Ui::Child directoryListing(State const &, Sys::Dir const &);

Expand All @@ -25,7 +25,7 @@ Ui::Child toolbar(State const &);

Ui::Child alert(State const &state, String title, String body);

/* --- Dialogs ------------------------------------------------------------ */
// MARK: Dialogs -------------------------------------------------------------

Ui::Child openFileDialog();

Expand Down
4 changes: 2 additions & 2 deletions src/apps/hideo-images/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Hideo::Images {

/* --- Reducer -------------------------------------------------------------- */
// MARK: Reducer ---------------------------------------------------------------

struct State {
bool isEditor = false;
Expand Down Expand Up @@ -37,7 +37,7 @@ void reduce(State &, Action);

using Model = Ui::Model<State, Action, reduce>;

/* --- Views ---------------------------------------------------------------- */
// MARK: Views -----------------------------------------------------------------

// Viewer

Expand Down
4 changes: 2 additions & 2 deletions src/apps/hideo-settings/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Hideo::Settings {

/* --- Model ---------------------------------------------------------------- */
// MARK: Model -----------------------------------------------------------------

enum struct Page {
HOME,
Expand Down Expand Up @@ -49,7 +49,7 @@ void reduce(State &, Action);

using Model = Ui::Model<State, Action, reduce>;

/* --- Views ---------------------------------------------------------------- */
// MARK: Views -----------------------------------------------------------------

Ui::Child pageScafold(Ui::Child inner);

Expand Down
4 changes: 2 additions & 2 deletions src/apps/hideo-settings/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Ui::Child sidebar(State const &state) {
return Hideo::sidenav(items);
}

/* --- Pages ---------------------------------------------------------------- */
// MARK: Pages -----------------------------------------------------------------

Ui::Child pageContent(State const &state) {
switch (state.page()) {
Expand All @@ -49,7 +49,7 @@ Ui::Child pageContent(State const &state) {
}
}

/* --- Body ----------------------------------------------------------------- */
// MARK: Body ------------------------------------------------------------------

Ui::Child app() {
return Ui::reducer<Model>({}, [](State const &s) {
Expand Down
8 changes: 4 additions & 4 deletions src/apps/hideo-shell/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Hideo::Shell {

/* --- Status Bar ----------------------------------------------------------- */
// MARK: Status Bar ------------------------------------------------------------

Ui::Child indicator(Media::Icon icon) {
return Ui::icon(icon) |
Expand Down Expand Up @@ -47,7 +47,7 @@ Ui::Child statusbarButton(State const &state) {
);
}

/* --- Navigation Bar ------------------------------------------------------- */
// MARK: Navigation Bar --------------------------------------------------------

Ui::Child navbar(State const &) {
return Ui::buttonHandle(
Expand All @@ -56,7 +56,7 @@ Ui::Child navbar(State const &) {
Ui::slideIn(Ui::SlideFrom::BOTTOM);
}

/* --- Taskbar -------------------------------------------------------------- */
// MARK: Taskbar ---------------------------------------------------------------

Ui::Child taskbar(State const &state) {
auto appsButton = Ui::button(
Expand Down Expand Up @@ -121,7 +121,7 @@ Ui::Child taskbar(State const &state) {
);
}

/* --- Shells --------------------------------------------------------------- */
// MARK: Shells ----------------------------------------------------------------

Ui::Child background(State const &state) {
return Ui::image(state.background) |
Expand Down
6 changes: 3 additions & 3 deletions src/apps/hideo-spreadsheet/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Hideo::Spreadsheet {

/* --- Reducer -------------------------------------------------------------- */
// MARK: Reducer ---------------------------------------------------------------

using Value = Union<None, String, f64, bool>;

Expand Down Expand Up @@ -203,7 +203,7 @@ struct State {
}
};

/* --- Actions -------------------------------------------------------------- */
// MARK: Actions ---------------------------------------------------------------

struct UpdateSelection {
Opt<Range> range;
Expand Down Expand Up @@ -270,7 +270,7 @@ Res<> save(Model const &model, Io::Writer &writer);

Res<Model> load(Io::Reader &reader);

/* --- Views ---------------------------------------------------------------- */
// MARK: Views -----------------------------------------------------------------

Ui::Child table(State const &s);

Expand Down
6 changes: 3 additions & 3 deletions src/apps/hideo-spreadsheet/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct Table : public Ui::View<Table> {
return _state->activeSheet();
}

/* --- Geometry --- */
// MARK: Geometry ----------------------------------------------------------

Math::Recti colHeaderBound(usize col) {
return {
Expand Down Expand Up @@ -50,7 +50,7 @@ struct Table : public Ui::View<Table> {
};
}

/* --- Events --- */
// MARK: Events ------------------------------------------------------------

void event(Sys::Event &e) override {
e.handle<Events::MouseEvent>([&](Events::MouseEvent const &m) {
Expand Down Expand Up @@ -80,7 +80,7 @@ struct Table : public Ui::View<Table> {
});
}

/* --- Painting --- */
// MARK: Painting ----------------------------------------------------------

void paintCell(Gfx::Context &g, Cell const &, Math::Recti bound) {
g.rect(bound.cast<f64>());
Expand Down
4 changes: 2 additions & 2 deletions src/impls/impl-efi/sys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Res<Strong<Sys::Fd>> createErr() {
return Ok(makeStrong<ConOut>(Efi::st()->stdErr));
}

/* --- Sockets -------------------------------------------------------------- */
// MARK: Sockets ---------------------------------------------------------------

Res<Strong<Sys::Fd>> connectTcp(SocketAddr) {
notImplemented();
Expand All @@ -210,7 +210,7 @@ Res<Strong<Sys::Fd>> listenIpc(Mime::Url) {
notImplemented();
}

/* --- Files ---------------------------------------------------------------- */
// MARK: Files -----------------------------------------------------------------

static Opt<Web::Json::Value> _index = NONE;

Expand Down
4 changes: 2 additions & 2 deletions src/impls/impl-hjert/new-delete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <karm-base/lock.h>
#include <karm-logger/logger.h>

/* --- Kmm Implementation -------------------------------------------------- */
// MARK: Kmm Implementation ---------------------------------------------------

static Lock _heapLock;
static Heap _heapImpl = {
Expand All @@ -25,7 +25,7 @@ static Heap _heapImpl = {
},
};

/* --- New/Delete Implementation -------------------------------------------- */
// MARK: New/Delete Implementation ---------------------------------------------

void *operator new(usize size) {
LockScope scope(_heapLock);
Expand Down
8 changes: 4 additions & 4 deletions src/impls/impl-posix/sys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Res<Stat> stat(Mime::Url const &url) {
return Ok(Posix::fromStat(buf));
}

/* --- Sockets -------------------------------------------------------------- */
// MARK: Sockets ---------------------------------------------------------------

Res<Strong<Sys::Fd>> listenUdp(SocketAddr addr) {
int fd = ::socket(AF_INET, SOCK_DGRAM, 0);
Expand Down Expand Up @@ -244,7 +244,7 @@ Res<Strong<Sys::Fd>> listenIpc(Mime::Url url) {
return Ok(makeStrong<Posix::Fd>(fd));
}

/* --- Time ----------------------------------------------------------------- */
// MARK: Time ------------------------------------------------------------------

TimeSpan fromTimeSpec(struct timespec const &ts) {
auto usecs = (u64)ts.tv_sec * 1000000 + (u64)ts.tv_nsec / 1000;
Expand All @@ -263,7 +263,7 @@ TimeSpan uptime() {
return fromTimeSpec(ts);
}

/* --- Memory Managment ----------------------------------------------------- */
// MARK: Memory Managment ------------------------------------------------------

isize mmapOptionsToProt(Sys::MmapOptions const &options) {
isize prot = 0;
Expand Down Expand Up @@ -365,7 +365,7 @@ Res<> populate(Vec<Sys::UserInfo> &infos) {
return Ok();
}

/* --- Process Managment ---------------------------------------------------- */
// MARK: Process Managment -----------------------------------------------------

Res<> sleep(TimeSpan span) {
struct timespec ts;
Expand Down
4 changes: 2 additions & 2 deletions src/impls/impl-skift/new-delete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <karm-base/lock.h>
#include <karm-logger/logger.h>

/* --- Heap Implementation -------------------------------------------------- */
// MARK: Heap Implementation ---------------------------------------------------

static constinit Lock _heapLock;
static constinit Heap _heapImpl = {
Expand All @@ -24,7 +24,7 @@ static constinit Heap _heapImpl = {
},
};

/* --- New/Delete Implementation -------------------------------------------- */
// MARK: New/Delete Implementation ---------------------------------------------

void *operator new(usize size) {
LockScope scope(_heapLock);
Expand Down
12 changes: 6 additions & 6 deletions src/impls/impl-skift/sys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Karm::Sys::_Embed {

/* --- File I/O ------------------------------------------------------------- */
// MARK: File I/O --------------------------------------------------------------

struct VmoFd : public Sys::Fd {
Hj::Vmo _vmo;
Expand Down Expand Up @@ -98,7 +98,7 @@ Res<Vec<Sys::DirEntry>> readDir(Mime::Url const &) {
notImplemented();
}

/* --- Sockets -------------------------------------------------------------- */
// MARK: Sockets ---------------------------------------------------------------

Res<Strong<Sys::Fd>> connectTcp(SocketAddr) {
notImplemented();
Expand All @@ -116,7 +116,7 @@ Res<Strong<Sys::Fd>> listenIpc(Mime::Url) {
notImplemented();
}

/* --- Time ----------------------------------------------------------------- */
// MARK: Time ------------------------------------------------------------------

TimeStamp now() {
return Hj::now().unwrap();
Expand All @@ -126,7 +126,7 @@ TimeSpan uptime() {
notImplemented();
}

/* --- Memory Managment ----------------------------------------------------- */
// MARK: Memory Managment ------------------------------------------------------

Res<Sys::MmapResult> memMap(Sys::MmapOptions const &) {
notImplemented();
Expand Down Expand Up @@ -155,7 +155,7 @@ Res<> memFlush(void *, usize) {
notImplemented();
}

/* --- System Informations -------------------------------------------------- */
// MARK: System Informations ---------------------------------------------------

Res<> populate(Sys::SysInfo &) {
notImplemented();
Expand All @@ -177,7 +177,7 @@ Res<> populate(Vec<Sys::UserInfo> &) {
notImplemented();
}

/* --- Process Managment ---------------------------------------------------- */
// MARK: Process Managment -----------------------------------------------------

Res<> sleep(TimeSpan) {
notImplemented();
Expand Down
6 changes: 3 additions & 3 deletions src/kernel/hal-x86_64/asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inline void invlpg(usize addr) {
: "memory");
}

/* --- CRs ------------------------------------------------------------------ */
// MARK: CRs -------------------------------------------------------------------

enum Cr0Bit {
CR0_PROTECTED_MODE_ENABLE = (1 << 0),
Expand Down Expand Up @@ -79,7 +79,7 @@ CR(4)

#undef CR

/* --- AVX/SSSE ------------------------------------------------------------- */
// MARK: AVX/SSSE --------------------------------------------------------------

enum Xcr0Bit {
XCR0_XSAVE_SAVE_X87 = (1 << 0),
Expand Down Expand Up @@ -133,7 +133,7 @@ inline void fxrstor(void const *region) {
asm volatile("fxrstor (%0)" ::"a"(region));
}

/* --- Msrs ----------------------------------------------------------------- */
// MARK: Msrs ------------------------------------------------------------------

enum struct Msrs : u64 {
APIC = 0x1B,
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/hjert-core/ctx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Hjert::Core {

/* --- Stack ----------------------------------------------------------------- */
// MARK: Stack ------------------------------------------------------------------

Res<Stack> Stack::create() {
logInfo("task: creating stack...");
Expand Down
Loading

0 comments on commit c5639ae

Please sign in to comment.