diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h index 074e7f8b..fb87793b 100644 --- a/include/X11/Xlibint.h +++ b/include/X11/Xlibint.h @@ -717,7 +717,7 @@ extern void _XRead32( * char. */ #define CI_GET_CHAR_INFO_1D(fs,col,def,cs) \ -{ \ +do { \ cs = def; \ if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ if (fs->per_char == NULL) { \ @@ -727,7 +727,7 @@ extern void _XRead32( if (CI_NONEXISTCHAR(cs)) cs = def; \ } \ } \ -} +} while (0) #define CI_GET_DEFAULT_INFO_1D(fs,cs) \ CI_GET_CHAR_INFO_1D (fs, fs->default_char, NULL, cs) @@ -739,7 +739,7 @@ extern void _XRead32( * column. This is used for fonts that have more than row zero. */ #define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \ -{ \ +do { \ cs = def; \ if (row >= fs->min_byte1 && row <= fs->max_byte1 && \ col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ @@ -753,14 +753,14 @@ extern void _XRead32( if (CI_NONEXISTCHAR(cs)) cs = def; \ } \ } \ -} +} while (0) #define CI_GET_DEFAULT_INFO_2D(fs,cs) \ -{ \ +do { \ unsigned int r = (fs->default_char >> 8); \ unsigned int c = (fs->default_char & 0xff); \ CI_GET_CHAR_INFO_2D (fs, r, c, NULL, cs); \ -} +} while (0) /* srcvar must be a variable for large architecture version */ diff --git a/modules/om/generic/omDefault.c b/modules/om/generic/omDefault.c index 322690fa..1bed9332 100644 --- a/modules/om/generic/omDefault.c +++ b/modules/om/generic/omDefault.c @@ -231,10 +231,10 @@ _XmbDefaultTextPerCharExtents(XOC oc, _Xconst char *text, int length, bzero((char *) &overall, sizeof(XCharStruct)); *num_chars = 0; - CI_GET_DEFAULT_INFO_1D(font, def) + CI_GET_DEFAULT_INFO_1D(font, def); while (length-- > 0) { - CI_GET_CHAR_INFO_1D(font, *text, def, cs) + CI_GET_CHAR_INFO_1D(font, *text, def, cs); text++; if (cs == NULL) continue; diff --git a/modules/om/generic/omTextPer.c b/modules/om/generic/omTextPer.c index ae08fe6a..2d770324 100644 --- a/modules/om/generic/omTextPer.c +++ b/modules/om/generic/omTextPer.c @@ -92,20 +92,20 @@ _XomGenericTextPerCharExtents( } if (is_xchar2b) { - CI_GET_DEFAULT_INFO_2D(font, def) + CI_GET_DEFAULT_INFO_2D(font, def); xchar2b_ptr = xchar2b_buf; } else { - CI_GET_DEFAULT_INFO_1D(font, def) + CI_GET_DEFAULT_INFO_1D(font, def); xchar_ptr = (char *) xchar2b_buf; } while (buf_len-- > 0) { if (is_xchar2b) { CI_GET_CHAR_INFO_2D(font, xchar2b_ptr->byte1, - xchar2b_ptr->byte2, def, cs) + xchar2b_ptr->byte2, def, cs); xchar2b_ptr++; } else { - CI_GET_CHAR_INFO_1D(font, *xchar_ptr, def, cs) + CI_GET_CHAR_INFO_1D(font, *xchar_ptr, def, cs); xchar_ptr++; } if (cs == NULL) diff --git a/src/TextExt.c b/src/TextExt.c index b883b01b..0f98f9b4 100644 --- a/src/TextExt.c +++ b/src/TextExt.c @@ -50,7 +50,7 @@ from The Open Group. */ #define CI_GET_ROWZERO_CHAR_INFO_2D(fs,col,def,cs) \ -{ \ +do { \ cs = def; \ if (fs->min_byte1 == 0 && \ col >= fs->min_byte2 && col <= fs->max_byte2) { \ @@ -61,7 +61,7 @@ from The Open Group. if (CI_NONEXISTCHAR(cs)) cs = def; \ } \ } \ -} +} while (0) /* diff --git a/src/xlibi18n/XDefaultOMIF.c b/src/xlibi18n/XDefaultOMIF.c index e8666628..59b5c5e2 100644 --- a/src/xlibi18n/XDefaultOMIF.c +++ b/src/xlibi18n/XDefaultOMIF.c @@ -693,10 +693,10 @@ _XmbDefaultTextPerCharExtents(XOC oc, _Xconst char *text, int length, bzero((char *) &overall, sizeof(XCharStruct)); *num_chars = 0; - CI_GET_DEFAULT_INFO_1D(font, def) + CI_GET_DEFAULT_INFO_1D(font, def); while (length-- > 0) { - CI_GET_CHAR_INFO_1D(font, *text, def, cs) + CI_GET_CHAR_INFO_1D(font, *text, def, cs); text++; if (cs == NULL) continue;