@@ -52,16 +52,19 @@ static void default_error_callback(int error, const char *description) {
5252 if (error_callback == nullptr ) {
5353 glfwSetErrorCallback (default_error_callback);
5454 }
55- if (!glfwInit ()) return nullptr ;
55+ if (!glfwInit ()) {
56+ return nullptr ;
57+ }
5658 glfwWindowHint (GLFW_CLIENT_API, GLFW_NO_API);
5759 context = (DebugGUIContext *)(malloc (sizeof (DebugGUIContext)));
5860 window = glfwCreateWindow (1280 , 720 , name, nullptr , nullptr );
5961
60- if (window == NULL ) return 0 ;
62+ if (window == nullptr ) {
63+ return nullptr ;
64+ }
6165
6266 context->window = window;
6367 context->device = MTLCreateSystemDefaultDevice ();
64- ;
6568 context->commandQueue = [context->device newCommandQueue ];
6669
6770 // Setup Platform/Renderer backends
@@ -77,11 +80,12 @@ static void default_error_callback(int error, const char *description) {
7780 icons_config.FontDataOwnedByAtlas = false ;
7881 icons_config.GlyphOffset = {0 , 2 };
7982 icons_config.GlyphMinAdvanceX = 17 ;
80- io.Fonts ->AddFontFromMemoryTTF ((void *)s_iconsFontAwesomeTtf,
81- sizeof (s_iconsFontAwesomeTtf), 13 .0f ,
82- &icons_config, icons_ranges);
83+ io.Fonts ->AddFontFromMemoryTTF ((void *)s_iconsFontAwesomeTtf, sizeof (s_iconsFontAwesomeTtf),
84+ 13 .0f , &icons_config, icons_ranges);
8385
84- if (io.Fonts ->ConfigData .empty ()) io.Fonts ->AddFontDefault ();
86+ if (io.Fonts ->ConfigData .empty ()) {
87+ io.Fonts ->AddFontDefault ();
88+ }
8589 // io.Fonts->Build();
8690 io.DisplaySize = ImVec2 (1280 , 720 );
8791 ImGui_ImplMetal_Init (context->device );
@@ -129,11 +133,12 @@ static void default_error_callback(int error, const char *description) {
129133 icons_config.GlyphOffset = {0 , 2 };
130134 icons_config.GlyphMinAdvanceX = 17 ;
131135 icons_config.FontDataOwnedByAtlas = false ;
132- io.Fonts ->AddFontFromMemoryTTF ((void *)s_iconsFontAwesomeTtf,
133- sizeof (s_iconsFontAwesomeTtf), 13 .0f ,
134- &icons_config, icons_ranges);
136+ io.Fonts ->AddFontFromMemoryTTF ((void *)s_iconsFontAwesomeTtf, sizeof (s_iconsFontAwesomeTtf),
137+ 13 .0f , &icons_config, icons_ranges);
135138
136- if (io.Fonts ->ConfigData .empty ()) io.Fonts ->AddFontDefault ();
139+ if (io.Fonts ->ConfigData .empty ()) {
140+ io.Fonts ->AddFontDefault ();
141+ }
137142 // io.Fonts->Build();
138143 io.DisplaySize = ImVec2 (1280 , 720 );
139144 ImGui_ImplMetal_Init (device);
@@ -154,7 +159,7 @@ bool pollGUIPreRender(void *context, float delta) {
154159 return true ;
155160 }
156161
157- DebugGUIContext *ctx = reinterpret_cast <DebugGUIContext *>(context);
162+ auto *ctx = reinterpret_cast <DebugGUIContext *>(context);
158163 NSWindow *nswin = glfwGetCocoaWindow (ctx->window );
159164 if (glfwWindowShouldClose (ctx->window )) {
160165 return false ;
@@ -186,7 +191,7 @@ void pollGUIPostRender(void *context, void *drawData) {
186191 if (!context) {
187192 return ;
188193 }
189- DebugGUIContext *ctx = reinterpret_cast <DebugGUIContext *>(context);
194+ auto *ctx = reinterpret_cast <DebugGUIContext *>(context);
190195 @autoreleasepool {
191196 auto drawable = [layer nextDrawable ];
192197
0 commit comments