From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 6602756c for ; Thu, 3 Nov 2016 10:50:58 -0500 (EST) Date: Thu, 3 Nov 2016 10:50:58 -0500 (EST) Message-Id: <10649129277601201920.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: pod2mdoc: write function prototypes without arguments using .Fn rather X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- write function prototypes without arguments using .Fn rather than .Fo Modified Files: -------------- pod2mdoc: pod2mdoc.c Revision Data ------------- Index: pod2mdoc.c =================================================================== RCS file: /home/cvs/mdocml/pod2mdoc/pod2mdoc.c,v retrieving revision 1.61 retrieving revision 1.62 diff -Lpod2mdoc.c -Lpod2mdoc.c -u -p -r1.61 -r1.62 --- pod2mdoc.c +++ pod2mdoc.c @@ -1243,33 +1243,37 @@ again: } putchar('\n'); buf[ifa++] = '\0'; - printf(".Fo %s\n", buf + ifo); dict_put(buf + ifo, 0, MDOC_Fo); buf[ifc++] = '\0'; - for (;;) { - cp = strchr(buf + ifa, ','); - if (cp != NULL) { - cp2 = cp; - *cp++ = '\0'; - } else - cp2 = strchr(buf + ifa, '\0'); - while (isalnum((unsigned char)cp2[-1]) || - '_' == cp2[-1]) - cp2--; - if ('\0' != *cp2) - dict_put(cp2, 0, MDOC_Fa); - register_type(buf + ifa); - if (strchr(buf + ifa, ' ') == NULL) - printf(".Fa %s\n", buf + ifa); - else - printf(".Fa \"%s\"\n", buf + ifa); - if (cp == NULL) - break; - while (*cp == ' ' || *cp == '\t') - cp++; - ifa = cp - buf; - } - puts(".Fc"); + if (strcmp(buf + ifa, "void")) { + printf(".Fo %s\n", buf + ifo); + for (;;) { + cp = strchr(buf + ifa, ','); + if (cp != NULL) { + cp2 = cp; + *cp++ = '\0'; + } else + cp2 = strchr(buf + ifa, '\0'); + while (isalnum((unsigned char)cp2[-1]) + || '_' == cp2[-1]) + cp2--; + if ('\0' != *cp2) + dict_put(cp2, 0, MDOC_Fa); + register_type(buf + ifa); + if (strchr(buf + ifa, ' ') == NULL) + printf(".Fa %s\n", buf + ifa); + else + printf(".Fa \"%s\"\n", + buf + ifa); + if (cp == NULL) + break; + while (*cp == ' ' || *cp == '\t') + cp++; + ifa = cp - buf; + } + puts(".Fc"); + } else + printf(".Fn %s void\n", buf + ifo); if (buf[ifc] == ';') ifc++; if (ifc < inl) { -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv