Skip to content

Commit 96a0030

Browse files
PiyushPatle26acassis
authored andcommitted
include/debug.h: fix checkpatch fallout in touched apps files
Clean up style issues in the files touched by the <nuttx/debug.h> include migration so the full apps-side PR passes checkpatch. Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
1 parent 9d849ad commit 96a0030

File tree

21 files changed

+842
-602
lines changed

21 files changed

+842
-602
lines changed

examples/nx/nx_events.c

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,30 @@
5252

5353
static void nxeg_redraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
5454
bool morem, FAR void *arg);
55-
static void nxeg_position(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
55+
static void nxeg_position(NXEGWINDOW hwnd,
56+
FAR const struct nxgl_size_s *size,
5657
FAR const struct nxgl_point_s *pos,
5758
FAR const struct nxgl_rect_s *bounds,
5859
FAR void *arg);
5960
#ifdef CONFIG_NX_XYINPUT
60-
static void nxeg_mousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
61+
static void nxeg_mousein(NXEGWINDOW hwnd,
62+
FAR const struct nxgl_point_s *pos,
6163
uint8_t buttons, FAR void *arg);
6264
#endif
6365

6466
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
65-
static void nxeg_tbredraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
67+
static void nxeg_tbredraw(NXEGWINDOW hwnd,
68+
FAR const struct nxgl_rect_s *rect,
6669
bool morem, FAR void *arg);
67-
static void nxeg_tbposition(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
70+
static void nxeg_tbposition(NXEGWINDOW hwnd,
71+
FAR const struct nxgl_size_s *size,
6872
FAR const struct nxgl_point_s *pos,
6973
FAR const struct nxgl_rect_s *bounds,
7074
FAR void *arg);
7175
#ifdef CONFIG_NX_XYINPUT
72-
static void nxeg_tbmousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
73-
uint8_t buttons, FAR void *arg);
76+
static void nxeg_tbmousein(NXEGWINDOW hwnd,
77+
FAR const struct nxgl_point_s *pos,
78+
uint8_t buttons, FAR void *arg);
7479
#endif
7580
#endif
7681

@@ -137,6 +142,7 @@ static inline void nxeg_fillwindow(NXEGWINDOW hwnd,
137142
printf("nxeg_fillwindow: nxtk_fillwindow failed: %d\n", errno);
138143
}
139144
#endif
145+
140146
#ifdef CONFIG_NX_KBD
141147
nxeg_filltext(hwnd, rect, st);
142148
#endif
@@ -148,8 +154,8 @@ static inline void nxeg_fillwindow(NXEGWINDOW hwnd,
148154

149155
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
150156
static inline void nxeg_filltoolbar(NXTKWINDOW htb,
151-
FAR const struct nxgl_rect_s *rect,
152-
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
157+
FAR const struct nxgl_rect_s *rect,
158+
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
153159
{
154160
int ret;
155161

@@ -181,7 +187,8 @@ static void nxeg_redraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
181187
* Name: nxeg_position
182188
****************************************************************************/
183189

184-
static void nxeg_position(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
190+
static void nxeg_position(NXEGWINDOW hwnd,
191+
FAR const struct nxgl_size_s *size,
185192
FAR const struct nxgl_point_s *pos,
186193
FAR const struct nxgl_rect_s *bounds,
187194
FAR void *arg)
@@ -190,15 +197,18 @@ static void nxeg_position(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
190197

191198
/* Report the position */
192199

193-
printf("nxeg_position%d: hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
200+
printf("nxeg_position%d: hwnd=%p size=(%d,%d) pos=(%d,%d) "
201+
"bounds={(%d,%d),(%d,%d)}\n",
194202
st->wnum, hwnd, size->w, size->h, pos->x, pos->y,
195203
bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y);
196204

197205
/* Have we picked off the window bounds yet? */
198206

199207
if (!b_haveresolution)
200208
{
201-
/* Save the window limits (these should be the same for all places and all windows */
209+
/* Save the window limits (these should be the same for all places
210+
* and all windows.
211+
*/
202212

203213
g_xres = bounds->pt2.x;
204214
g_yres = bounds->pt2.y;
@@ -228,7 +238,8 @@ static void nxeg_mousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
228238
****************************************************************************/
229239

230240
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
231-
static void nxeg_tbredraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
241+
static void nxeg_tbredraw(NXEGWINDOW hwnd,
242+
FAR const struct nxgl_rect_s *rect,
232243
bool more, FAR void *arg)
233244
{
234245
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;
@@ -245,16 +256,18 @@ static void nxeg_tbredraw(NXEGWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
245256
****************************************************************************/
246257

247258
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
248-
static void nxeg_tbposition(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
249-
FAR const struct nxgl_point_s *pos,
250-
FAR const struct nxgl_rect_s *bounds,
251-
FAR void *arg)
259+
static void nxeg_tbposition(NXEGWINDOW hwnd,
260+
FAR const struct nxgl_size_s *size,
261+
FAR const struct nxgl_point_s *pos,
262+
FAR const struct nxgl_rect_s *bounds,
263+
FAR void *arg)
252264
{
253265
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;
254266

255267
/* Report the position */
256268

257-
printf("nxeg_ptbosition%d: hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
269+
printf("nxeg_ptbosition%d: hwnd=%p size=(%d,%d) pos=(%d,%d) "
270+
"bounds={(%d,%d),(%d,%d)}\n",
258271
st->wnum, hwnd, size->w, size->h, pos->x, pos->y,
259272
bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y);
260273
}
@@ -266,8 +279,9 @@ static void nxeg_tbposition(NXEGWINDOW hwnd, FAR const struct nxgl_size_s *size,
266279

267280
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
268281
#ifdef CONFIG_NX_XYINPUT
269-
static void nxeg_tbmousein(NXEGWINDOW hwnd, FAR const struct nxgl_point_s *pos,
270-
uint8_t buttons, FAR void *arg)
282+
static void nxeg_tbmousein(NXEGWINDOW hwnd,
283+
FAR const struct nxgl_point_s *pos,
284+
uint8_t buttons, FAR void *arg)
271285
{
272286
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;
273287

@@ -291,7 +305,7 @@ FAR void *nx_listenerthread(FAR void *arg)
291305

292306
/* Process events forever */
293307

294-
for (;;)
308+
for (; ; )
295309
{
296310
/* Handle the next event. If we were configured blocking, then
297311
* we will stay right here until the next event is received. Since

examples/nx/nx_kbdin.c

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ static void nxeg_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
109109
if (!nxgl_nullrect(&intersection))
110110
{
111111
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
112-
ret = nxtk_bitmapwindow((NXTKWINDOW)hwnd, &intersection, (FAR const void **)&src,
112+
ret = nxtk_bitmapwindow((NXTKWINDOW)hwnd, &intersection,
113+
(FAR const void **)&src,
113114
&bm->bounds.pt1,
114115
(unsigned int)bm->glyph->stride);
115116
if (ret < 0)
@@ -165,7 +166,7 @@ nxeg_renderglyph(FAR struct nxeg_state_s *st,
165166
/* Allocate memory to hold the glyph with its offsets */
166167

167168
glyph->stride = (glyph->width * CONFIG_EXAMPLES_NX_BPP + 7) / 8;
168-
bmsize = glyph->stride * glyph->height;
169+
bmsize = glyph->stride * glyph->height;
169170
glyph->bitmap = (FAR uint8_t *)malloc(bmsize);
170171

171172
if (glyph->bitmap)
@@ -178,13 +179,13 @@ nxeg_renderglyph(FAR struct nxeg_state_s *st,
178179
/* Pack 1-bit pixels into a 2-bits */
179180

180181
pixel &= 0x01;
181-
pixel = (pixel) << 1 |pixel;
182+
pixel = (pixel) << 1 | pixel;
182183
# endif
183184
# if CONFIG_EXAMPLES_NX_BPP < 4
184185
/* Pack 2-bit pixels into a nibble */
185186

186187
pixel &= 0x03;
187-
pixel = (pixel) << 2 |pixel;
188+
pixel = (pixel) << 2 | pixel;
188189
# endif
189190

190191
/* Pack 4-bit nibbles into a byte */
@@ -222,7 +223,7 @@ nxeg_renderglyph(FAR struct nxeg_state_s *st,
222223

223224
/* Then render the glyph into the allocated memory */
224225

225-
ret = RENDERER((FAR nxgl_mxpixel_t*)glyph->bitmap,
226+
ret = RENDERER((FAR nxgl_mxpixel_t *)glyph->bitmap,
226227
glyph->height, glyph->width, glyph->stride,
227228
bm, CONFIG_EXAMPLES_NX_FONTCOLOR);
228229
if (ret < 0)
@@ -236,9 +237,9 @@ nxeg_renderglyph(FAR struct nxeg_state_s *st,
236237
}
237238
else
238239
{
239-
/* Make it permanent */
240+
/* Make it permanent */
240241

241-
st->nglyphs++;
242+
st->nglyphs++;
242243
}
243244
}
244245
}
@@ -269,6 +270,7 @@ nxeg_addspace(FAR struct nxeg_state_s *st, uint8_t ch)
269270

270271
st->nglyphs++;
271272
}
273+
272274
return glyph;
273275
}
274276

@@ -283,13 +285,14 @@ nxeg_findglyph(FAR struct nxeg_state_s *st, uint8_t ch)
283285

284286
/* First, try to find the glyph in the cache of pre-rendered glyphs */
285287

286-
for (i = 0; i < st->nglyphs; i++)
288+
for (i = 0; i < st->nglyphs; i++)
287289
{
288290
if (st->glyph[i].code == ch)
289291
{
290292
return &st->glyph[i];
291293
}
292294
}
295+
293296
return NULL;
294297
}
295298

@@ -313,21 +316,22 @@ nxeg_getglyph(FAR struct nxeg_state_s *st, uint8_t ch)
313316
bm = nxf_getbitmap(g_fonthandle, ch);
314317
if (!bm)
315318
{
316-
/* No, there is no glyph for this code. Use space */
319+
/* No, there is no glyph for this code. Use space. */
317320

318321
glyph = nxeg_findglyph(st, ' ');
319322
if (!glyph)
320323
{
321-
/* There isn't fake glyph for ' ' yet... create one */
324+
/* There isn't a fake glyph for ' ' yet... create one */
322325

323326
glyph = nxeg_addspace(st, ' ');
324327
}
325328
}
326329
else
327330
{
328-
glyph = nxeg_renderglyph(st, bm, ch);
331+
glyph = nxeg_renderglyph(st, bm, ch);
329332
}
330333
}
334+
331335
return glyph;
332336
}
333337

@@ -346,41 +350,42 @@ nxeg_addchar(FAR struct nxeg_state_s *st, uint8_t ch)
346350

347351
if (st->nchars < NXTK_MAXKBDCHARS)
348352
{
349-
/* Yes, setup the bitmap */
353+
/* Yes, setup the bitmap */
350354

351-
bm = &st->bm[st->nchars];
355+
bm = &st->bm[st->nchars];
352356

353-
/* Find the matching glyph */
357+
/* Find the matching glyph */
354358

355-
bm->glyph = nxeg_getglyph(st, ch);
356-
if (!bm->glyph)
357-
{
358-
return NULL;
359-
}
359+
bm->glyph = nxeg_getglyph(st, ch);
360+
if (!bm->glyph)
361+
{
362+
return NULL;
363+
}
360364

361-
/* Set up the bounds for the bitmap */
365+
/* Set up the bounds for the bitmap */
362366

363-
if (st->nchars <= 0)
364-
{
365-
/* The first character is one space from the left */
367+
if (st->nchars <= 0)
368+
{
369+
/* The first character is one space from the left */
366370

367-
leftx = st->spwidth;
368-
}
369-
else
370-
{
371-
/* Otherwise, it is to the left of the preceding char */
371+
leftx = st->spwidth;
372+
}
373+
else
374+
{
375+
/* Otherwise, it is to the left of the preceding char */
372376

373-
bmleft = &st->bm[st->nchars-1];
374-
leftx = bmleft->bounds.pt2.x + 1;
375-
}
377+
bmleft = &st->bm[st->nchars - 1];
378+
leftx = bmleft->bounds.pt2.x + 1;
379+
}
376380

377-
bm->bounds.pt1.x = leftx;
378-
bm->bounds.pt1.y = 2;
379-
bm->bounds.pt2.x = leftx + bm->glyph->width - 1;
380-
bm->bounds.pt2.y = 2 + bm->glyph->height - 1;
381+
bm->bounds.pt1.x = leftx;
382+
bm->bounds.pt1.y = 2;
383+
bm->bounds.pt2.x = leftx + bm->glyph->width - 1;
384+
bm->bounds.pt2.y = 2 + bm->glyph->height - 1;
381385

382-
st->nchars++;
386+
st->nchars++;
383387
}
388+
384389
return bm;
385390
}
386391

@@ -424,10 +429,12 @@ void nxeg_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
424429
****************************************************************************/
425430

426431
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
427-
void nxeg_tbkbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg)
432+
void nxeg_tbkbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch,
433+
FAR void *arg)
428434
{
429435
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;
430-
printf("nxeg_tbkbdin: ERROR -- toolbar should not received keyboard input\n");
436+
printf("nxeg_tbkbdin: ERROR -- toolbar should not received keyboard "
437+
"input\n");
431438
printf("nxeg_tbkbdin%d: hwnd=%p nch=%d\n", st->wnum, hwnd, nch);
432439
}
433440
#endif

0 commit comments

Comments
 (0)