Change isspace() macro name to avoid conflict.
This commit is contained in:
parent
9ac362ddff
commit
2ea6270424
@ -280,7 +280,7 @@ sc_remove_all_mouse(sc_softc_t *sc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define isspace(c) (((c) & 0xff) == ' ')
|
#define IS_SPACE_CHAR(c) (((c) & 0xff) == ' ')
|
||||||
|
|
||||||
/* skip spaces to right */
|
/* skip spaces to right */
|
||||||
static int
|
static int
|
||||||
@ -291,7 +291,7 @@ skip_spc_right(scr_stat *scp, int p)
|
|||||||
|
|
||||||
for (i = p % scp->xsize; i < scp->xsize; ++i) {
|
for (i = p % scp->xsize; i < scp->xsize; ++i) {
|
||||||
c = sc_vtb_getc(&scp->vtb, p);
|
c = sc_vtb_getc(&scp->vtb, p);
|
||||||
if (!isspace(c))
|
if (!IS_SPACE_CHAR(c))
|
||||||
break;
|
break;
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
@ -307,7 +307,7 @@ skip_spc_left(scr_stat *scp, int p)
|
|||||||
|
|
||||||
for (i = p-- % scp->xsize - 1; i >= 0; --i) {
|
for (i = p-- % scp->xsize - 1; i >= 0; --i) {
|
||||||
c = sc_vtb_getc(&scp->vtb, p);
|
c = sc_vtb_getc(&scp->vtb, p);
|
||||||
if (!isspace(c))
|
if (!IS_SPACE_CHAR(c))
|
||||||
break;
|
break;
|
||||||
--p;
|
--p;
|
||||||
}
|
}
|
||||||
@ -340,7 +340,7 @@ mouse_cut(scr_stat *scp)
|
|||||||
for (p = from, i = blank = 0; p <= to; ++p) {
|
for (p = from, i = blank = 0; p <= to; ++p) {
|
||||||
cut_buffer[i] = sc_vtb_getc(&scp->vtb, p);
|
cut_buffer[i] = sc_vtb_getc(&scp->vtb, p);
|
||||||
/* remember the position of the last non-space char */
|
/* remember the position of the last non-space char */
|
||||||
if (!isspace(cut_buffer[i++]))
|
if (!IS_SPACE_CHAR(cut_buffer[i++]))
|
||||||
blank = i; /* the first space after the last non-space */
|
blank = i; /* the first space after the last non-space */
|
||||||
/* trim trailing blank when crossing lines */
|
/* trim trailing blank when crossing lines */
|
||||||
if ((p % scp->xsize) == (scp->xsize - 1)) {
|
if ((p % scp->xsize) == (scp->xsize - 1)) {
|
||||||
@ -354,7 +354,7 @@ mouse_cut(scr_stat *scp)
|
|||||||
--p;
|
--p;
|
||||||
for (i = p % scp->xsize; i < scp->xsize; ++i) {
|
for (i = p % scp->xsize; i < scp->xsize; ++i) {
|
||||||
c = sc_vtb_getc(&scp->vtb, p);
|
c = sc_vtb_getc(&scp->vtb, p);
|
||||||
if (!isspace(c))
|
if (!IS_SPACE_CHAR(c))
|
||||||
break;
|
break;
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
@ -468,17 +468,17 @@ mouse_cut_word(scr_stat *scp)
|
|||||||
sol = (scp->mouse_pos / scp->xsize) * scp->xsize;
|
sol = (scp->mouse_pos / scp->xsize) * scp->xsize;
|
||||||
eol = sol + scp->xsize;
|
eol = sol + scp->xsize;
|
||||||
c = sc_vtb_getc(&scp->vtb, scp->mouse_pos);
|
c = sc_vtb_getc(&scp->vtb, scp->mouse_pos);
|
||||||
if (isspace(c)) {
|
if (IS_SPACE_CHAR(c)) {
|
||||||
/* blank space */
|
/* blank space */
|
||||||
for (j = scp->mouse_pos; j >= sol; --j) {
|
for (j = scp->mouse_pos; j >= sol; --j) {
|
||||||
c = sc_vtb_getc(&scp->vtb, j);
|
c = sc_vtb_getc(&scp->vtb, j);
|
||||||
if (!isspace(c))
|
if (!IS_SPACE_CHAR(c))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
start = ++j;
|
start = ++j;
|
||||||
for (j = scp->mouse_pos; j < eol; ++j) {
|
for (j = scp->mouse_pos; j < eol; ++j) {
|
||||||
c = sc_vtb_getc(&scp->vtb, j);
|
c = sc_vtb_getc(&scp->vtb, j);
|
||||||
if (!isspace(c))
|
if (!IS_SPACE_CHAR(c))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
end = j - 1;
|
end = j - 1;
|
||||||
@ -486,13 +486,13 @@ mouse_cut_word(scr_stat *scp)
|
|||||||
/* non-space word */
|
/* non-space word */
|
||||||
for (j = scp->mouse_pos; j >= sol; --j) {
|
for (j = scp->mouse_pos; j >= sol; --j) {
|
||||||
c = sc_vtb_getc(&scp->vtb, j);
|
c = sc_vtb_getc(&scp->vtb, j);
|
||||||
if (isspace(c))
|
if (IS_SPACE_CHAR(c))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
start = ++j;
|
start = ++j;
|
||||||
for (j = scp->mouse_pos; j < eol; ++j) {
|
for (j = scp->mouse_pos; j < eol; ++j) {
|
||||||
c = sc_vtb_getc(&scp->vtb, j);
|
c = sc_vtb_getc(&scp->vtb, j);
|
||||||
if (isspace(c))
|
if (IS_SPACE_CHAR(c))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
end = j - 1;
|
end = j - 1;
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
#include <dev/vinum/vinumext.h>
|
#include <dev/vinum/vinumext.h>
|
||||||
|
|
||||||
#ifdef KERNEL
|
#ifdef KERNEL
|
||||||
#define isspace(c) ((c == ' ') || (c == '\t')) /* check for white space */
|
#define SPACETAB(c) ((c == ' ') || (c == '\t')) /* check for white space */
|
||||||
#else /* get it from the headers */
|
#else /* get it from the headers */
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#endif
|
#endif
|
||||||
@ -184,7 +184,7 @@ tokenize(char *cptr, char *token[])
|
|||||||
tokennr = 0; /* none found yet */
|
tokennr = 0; /* none found yet */
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
while (isspace(*cptr))
|
while (SPACETAB(*cptr))
|
||||||
cptr++; /* skip initial white space */
|
cptr++; /* skip initial white space */
|
||||||
if ((*cptr == '\0') || (*cptr == '\n') || (*cptr == '#')) /* end of line */
|
if ((*cptr == '\0') || (*cptr == '\n') || (*cptr == '#')) /* end of line */
|
||||||
return tokennr; /* return number of tokens found */
|
return tokennr; /* return number of tokens found */
|
||||||
@ -197,14 +197,14 @@ tokenize(char *cptr, char *token[])
|
|||||||
cptr++;
|
cptr++;
|
||||||
if ((*cptr == delim) && (cptr[-1] != '\\')) { /* found the partner */
|
if ((*cptr == delim) && (cptr[-1] != '\\')) { /* found the partner */
|
||||||
cptr++; /* move on past */
|
cptr++; /* move on past */
|
||||||
if (!isspace(*cptr)) /* error, no space after closing quote */
|
if (!SPACETAB(*cptr)) /* error, no space after closing quote */
|
||||||
return -1;
|
return -1;
|
||||||
*cptr++ = '\0'; /* delimit */
|
*cptr++ = '\0'; /* delimit */
|
||||||
} else if ((*cptr == '\0') || (*cptr == '\n')) /* end of line */
|
} else if ((*cptr == '\0') || (*cptr == '\n')) /* end of line */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else { /* not quoted */
|
} else { /* not quoted */
|
||||||
while ((*cptr != '\0') && (!isspace(*cptr)) && (*cptr != '\n'))
|
while ((*cptr != '\0') && (!SPACETAB(*cptr)) && (*cptr != '\n'))
|
||||||
cptr++;
|
cptr++;
|
||||||
if (*cptr != '\0') /* not end of the line, */
|
if (*cptr != '\0') /* not end of the line, */
|
||||||
*cptr++ = '\0'; /* delimit and move to the next */
|
*cptr++ = '\0'; /* delimit and move to the next */
|
||||||
|
Loading…
Reference in New Issue
Block a user