@@ -97,12 +97,14 @@ EGLBoolean eglChooseConfig(EGLDisplay dpy,
9797 EGLConfig* configs,
9898 EGLint config_size,
9999 EGLint* num_config) {
100- if (!check_display (dpy) || !check_initialized (dpy))
100+ if (!check_display (dpy) || !check_initialized (dpy)) {
101101 return EGL_FALSE;
102+ }
102103
103104 if (configs == nullptr ) {
104- if (num_config != nullptr )
105+ if (num_config != nullptr ) {
105106 *num_config = 1 ;
107+ }
106108 return bool_success ();
107109 }
108110
@@ -112,8 +114,9 @@ EGLBoolean eglChooseConfig(EGLDisplay dpy,
112114 n_returned++;
113115 }
114116
115- if (num_config != nullptr )
117+ if (num_config != nullptr ) {
116118 *num_config = n_returned;
119+ }
117120
118121 return bool_success ();
119122}
@@ -122,8 +125,9 @@ EGLContext eglCreateContext(EGLDisplay dpy,
122125 EGLConfig config,
123126 EGLContext share_context,
124127 const EGLint* attrib_list) {
125- if (!check_display (dpy) || !check_initialized (dpy) || !check_config (config))
128+ if (!check_display (dpy) || !check_initialized (dpy) || !check_config (config)) {
126129 return EGL_NO_CONTEXT;
130+ }
127131
128132 mock_error = EGL_SUCCESS;
129133 return &mock_context;
@@ -132,8 +136,9 @@ EGLContext eglCreateContext(EGLDisplay dpy,
132136EGLSurface eglCreatePbufferSurface (EGLDisplay dpy,
133137 EGLConfig config,
134138 const EGLint* attrib_list) {
135- if (!check_display (dpy) || !check_initialized (dpy) || !check_config (config))
139+ if (!check_display (dpy) || !check_initialized (dpy) || !check_config (config)) {
136140 return EGL_NO_SURFACE;
141+ }
137142
138143 mock_error = EGL_SUCCESS;
139144 return &mock_surface;
@@ -143,8 +148,9 @@ EGLSurface eglCreateWindowSurface(EGLDisplay dpy,
143148 EGLConfig config,
144149 EGLNativeWindowType win,
145150 const EGLint* attrib_list) {
146- if (!check_display (dpy) || !check_initialized (dpy) || !check_config (config))
151+ if (!check_display (dpy) || !check_initialized (dpy) || !check_config (config)) {
147152 return EGL_NO_SURFACE;
153+ }
148154
149155 mock_error = EGL_SUCCESS;
150156 return &mock_surface;
@@ -154,8 +160,9 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy,
154160 EGLConfig config,
155161 EGLint attribute,
156162 EGLint* value) {
157- if (!check_display (dpy) || !check_initialized (dpy) || !check_config (config))
163+ if (!check_display (dpy) || !check_initialized (dpy) || !check_config (config)) {
158164 return EGL_FALSE;
165+ }
159166
160167 MockConfig* c = static_cast <MockConfig*>(config);
161168 switch (attribute) {
@@ -261,8 +268,9 @@ void (*eglGetProcAddress(const char* procname))(void) {
261268}
262269
263270EGLBoolean eglInitialize (EGLDisplay dpy, EGLint* major, EGLint* minor) {
264- if (!check_display (dpy))
271+ if (!check_display (dpy)) {
265272 return EGL_FALSE;
273+ }
266274
267275 if (!display_initialized) {
268276 mock_config.config_id = 1 ;
@@ -295,10 +303,12 @@ EGLBoolean eglInitialize(EGLDisplay dpy, EGLint* major, EGLint* minor) {
295303 display_initialized = true ;
296304 }
297305
298- if (major != nullptr )
306+ if (major != nullptr ) {
299307 *major = 1 ;
300- if (minor != nullptr )
301- *major = 5 ;
308+ }
309+ if (minor != nullptr ) {
310+ *minor = 5 ;
311+ }
302312
303313 return bool_success ();
304314}
@@ -307,15 +317,17 @@ EGLBoolean eglMakeCurrent(EGLDisplay dpy,
307317 EGLSurface draw,
308318 EGLSurface read,
309319 EGLContext ctx) {
310- if (!check_display (dpy) || !check_initialized (dpy))
320+ if (!check_display (dpy) || !check_initialized (dpy)) {
311321 return EGL_FALSE;
322+ }
312323
313324 return bool_success ();
314325}
315326
316327EGLBoolean eglSwapBuffers (EGLDisplay dpy, EGLSurface surface) {
317- if (!check_display (dpy) || !check_initialized (dpy))
328+ if (!check_display (dpy) || !check_initialized (dpy)) {
318329 return EGL_FALSE;
330+ }
319331
320332 return bool_success ();
321333}
0 commit comments