Skip to content

Commit c014061

Browse files
committed
Cleanup
1 parent be4ad33 commit c014061

File tree

17 files changed

+3
-128
lines changed

17 files changed

+3
-128
lines changed

src/app.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ struct window_common {
2222
struct gfx *gfx[APP_GFX_LAYERS];
2323
struct gfx_ui *gfx_ui;
2424
struct gfx_ctx *gfx_ctx;
25-
26-
struct window_error_handling {
27-
MTY_App *app;
28-
MTY_Window window; // TODO THis is SOO ugly, refactor
29-
MTY_WindowErrorFunc handler;
30-
void *opaque;
31-
} error_handling;
3225
};
3326

3427
// App

src/error.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ void error_local_push_error(MTY_Error error)
3838
if (!Q)
3939
return;
4040

41-
// TODO: Maybe don't push onto queue when error is 0?
42-
4341
MTY_Error *buf = MTY_QueueGetInputBuffer(Q);
4442
if (buf) {
4543
*buf = error;

src/gfx/gl/gl-ui.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,3 @@ void mty_gl_ui_destroy(struct gfx_ui **gfx_ui, MTY_Device *device)
290290
MTY_Free(ctx);
291291
*gfx_ui = NULL;
292292
}
293-
294-
int32_t mty_gl_ui_get_error(struct gfx_ui *gfx_ui)
295-
{
296-
return 0;
297-
}

src/gfx/mod-ctx.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
struct gfx_ctx;
1616

17-
typedef int32_t (*gfx_error_handler_func)(int32_t e1, int32_t e2, void *opaque);
18-
1917
#define GFX_CTX_PROTO(api, name) mty##api##ctx_##name
2018
#define GFX_CTX_FP(api, name) (*name)
2119

@@ -29,9 +27,7 @@ typedef int32_t (*gfx_error_handler_func)(int32_t e1, int32_t e2, void *opaque);
2927
MTY_Surface *wrap(api, get_surface)(struct gfx_ctx *gfx_ctx); \
3028
void wrap(api, set_sync_interval)(struct gfx_ctx *gfx_ctx, uint32_t interval); \
3129
bool wrap(api, lock)(struct gfx_ctx *gfx_ctx); \
32-
void wrap(api, unlock)(void); \
33-
void wrap(api, set_error_handler)(struct gfx_ctx *gfx_ctx, gfx_error_handler_func func, void *opaque); \
34-
int32_t wrap(api, get_error)(struct gfx_ctx *gfx_ctx);
30+
void wrap(api, unlock)(void);
3531

3632
#define GFX_CTX_PROTOTYPES(api) \
3733
GFX_CTX_DECLARE_API(api, GFX_CTX_PROTO)
@@ -48,6 +44,4 @@ typedef int32_t (*gfx_error_handler_func)(int32_t e1, int32_t e2, void *opaque);
4844
mty##api##ctx_set_sync_interval, \
4945
mty##api##ctx_lock, \
5046
mty##api##ctx_unlock, \
51-
mty##api##ctx_set_error_handler, \
52-
mty##api##ctx_get_error, \
5347
},

src/gfx/mod-ui.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ struct gfx_ui;
2929
void *wrap(api, create_texture)(struct gfx_ui *gfx_ui, MTY_Device *device, \
3030
const void *rgba, uint32_t width, uint32_t height); \
3131
void wrap(api, destroy_texture)(struct gfx_ui *gfx_ui, void **texture, \
32-
MTY_Device *device); \
33-
int32_t wrap(api, get_error)(struct gfx_ui *gfx_ui);
32+
MTY_Device *device);
3433

3534
#define GFX_UI_PROTOTYPES(api) \
3635
GFX_UI_DECLARE_API(api, GFX_UI_PROTO)
@@ -42,5 +41,4 @@ struct gfx_ui;
4241
mty##api##ui_render, \
4342
mty##api##ui_create_texture, \
4443
mty##api##ui_destroy_texture, \
45-
mty##api##ui_get_error, \
4644
},

src/gfx/vk/vk-ctx.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -720,13 +720,3 @@ bool mty_vk_ctx_lock(struct gfx_ctx *gfx_ctx)
720720
void mty_vk_ctx_unlock(void)
721721
{
722722
}
723-
724-
void mty_vk_ctx_set_error_handler(struct gfx_ctx *gfx_ctx, gfx_error_handler_func func, void *opaque)
725-
{
726-
gfx_ctx; func; opaque;
727-
}
728-
729-
int32_t mty_vk_ctx_get_error(struct gfx_ctx *gfx_ctx)
730-
{
731-
return 0;
732-
}

src/gfx/vk/vk-ui.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,3 @@ void mty_vk_ui_destroy(struct gfx_ui **gfx_ui, MTY_Device *device)
639639
MTY_Free(ctx);
640640
*gfx_ui = NULL;
641641
}
642-
643-
int32_t mty_vk_ui_get_error(struct gfx_ui *gfx_ui)
644-
{
645-
return 0;
646-
}

src/matoya.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ typedef bool (*MTY_MenuItemCheckedFunc)(void *opaque);
7777
typedef intptr_t (*MTY_WMsgFunc)(MTY_App *app, MTY_Window window, void *hwnd, uint32_t msg,
7878
intptr_t wparam, uintptr_t lparam, bool *shouldReturn, void *opaque);
7979

80-
typedef int32_t (*MTY_WindowErrorFunc)(MTY_App *app, MTY_Window window, int32_t error, int32_t internal_error, void *opaque);
81-
8280
/// @brief Error codes indicating the current state of the platform.
8381
/// @details Warnings are positive, errors are negative, 0 (::MTY_ERROR_OK) means no error.
8482
typedef enum {
@@ -1075,9 +1073,6 @@ MTY_WindowCreate(MTY_App *app, const char *title, const MTY_Frame *frame, MTY_Wi
10751073
MTY_EXPORT void
10761074
MTY_WindowDestroy(MTY_App *app, MTY_Window window);
10771075

1078-
MTY_EXPORT void
1079-
MTY_WindowSetErrorHandler(MTY_App *app, MTY_Window window, MTY_WindowErrorFunc func, void *opaque);
1080-
10811076
/// @brief Get a window's current client area width and height.
10821077
/// @param app The MTY_App.
10831078
/// @param window An MTY_Window.

src/thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
MTY_Error MTY_ThreadGetError(MTY_Thread *ctx)
1818
{
19-
ctx; // not used since errors are managed via tlocal state
19+
// `ctx` is not used since errors are managed via tlocal state
2020

2121
MTY_Error e = MTY_ERROR_OK;
2222
error_local_get_next_error(&e);

src/unix/apple/macosx/gfx/metal-ctx.m

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,3 @@ bool mty_metal_ctx_lock(struct gfx_ctx *gfx_ctx)
172172
void mty_metal_ctx_unlock(void)
173173
{
174174
}
175-
176-
void mty_metal_ctx_set_error_handler(struct gfx_ctx *gfx_ctx, gfx_error_handler_func func, void *opaque)
177-
{
178-
gfx_ctx; func; opaque;
179-
}
180-
181-
int32_t mty_metal_ctx_get_error(struct gfx_ctx *gfx_ctx)
182-
{
183-
return 0;
184-
}

0 commit comments

Comments
 (0)