=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/chars.c,v retrieving revision 1.36 retrieving revision 1.37 diff -c -r1.36 -r1.37 *** src/usr.bin/mandoc/chars.c 2015/02/17 20:33:44 1.36 --- src/usr.bin/mandoc/chars.c 2015/10/06 18:30:43 1.37 *************** *** 1,4 **** ! /* $OpenBSD: chars.c,v 1.36 2015/02/17 20:33:44 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: chars.c,v 1.37 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014 Ingo Schwarze *************** *** 93,99 **** } tab->htab = htab; ! return(tab); } int --- 93,99 ---- } tab->htab = htab; ! return tab; } int *************** *** 102,108 **** const struct ln *ln; ln = find(arg, p, sz); ! return(ln != NULL ? ln->unicode : sz == 1 ? (unsigned char)*p : -1); } int --- 102,108 ---- const struct ln *ln; ln = find(arg, p, sz); ! return ln != NULL ? ln->unicode : sz == 1 ? (unsigned char)*p : -1; } int *************** *** 111,117 **** int i; i = mandoc_strntoi(p, sz, 10); ! return(i >= 0 && i < 256 ? i : -1); } int --- 111,117 ---- int i; i = mandoc_strntoi(p, sz, 10); ! return i >= 0 && i < 256 ? i : -1; } int *************** *** 121,127 **** i = mandoc_strntoi(p, sz, 16); assert(i >= 0 && i <= 0x10FFFF); ! return(i); } const char * --- 121,127 ---- i = mandoc_strntoi(p, sz, 16); assert(i >= 0 && i <= 0x10FFFF); ! return i; } const char * *************** *** 133,143 **** ln = find(arg, p, sz); if (ln == NULL) { *rsz = 1; ! return(sz == 1 ? p : NULL); } *rsz = strlen(ln->ascii); ! return(ln->ascii); } const char * --- 133,143 ---- ln = find(arg, p, sz); if (ln == NULL) { *rsz = 1; ! return sz == 1 ? p : NULL; } *rsz = strlen(ln->ascii); ! return ln->ascii; } const char * *************** *** 147,154 **** for (i = 0; i < LINES_MAX; i++) if (uc == lines[i].unicode) ! return(lines[i].ascii); ! return(""); } static const struct ln * --- 147,154 ---- for (i = 0; i < LINES_MAX; i++) if (uc == lines[i].unicode) ! return lines[i].ascii; ! return ""; } static const struct ln * *************** *** 160,173 **** assert(p); if (0 == sz || p[0] < PRINT_LO || p[0] > PRINT_HI) ! return(NULL); hash = (int)p[0] - PRINT_LO; for (pp = tab->htab[hash]; pp; pp = pp->next) if (0 == strncmp(pp->code, p, sz) && '\0' == pp->code[(int)sz]) ! return(pp); ! return(NULL); } --- 160,173 ---- assert(p); if (0 == sz || p[0] < PRINT_LO || p[0] > PRINT_HI) ! return NULL; hash = (int)p[0] - PRINT_LO; for (pp = tab->htab[hash]; pp; pp = pp->next) if (0 == strncmp(pp->code, p, sz) && '\0' == pp->code[(int)sz]) ! return pp; ! return NULL; }