From 0b1810574f85f9345450c4699411ce94569f361a Mon Sep 17 00:00:00 2001 From: mdw Date: Sat, 13 Nov 1999 01:54:32 +0000 Subject: [PATCH] Format source code properly ;-). Attach suffixes to the `max' constants. --- mptypes.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/mptypes.c b/mptypes.c index 8751e2e..28f44c4 100644 --- a/mptypes.c +++ b/mptypes.c @@ -1,8 +1,43 @@ /* -*-c-*- * - * Program to find appropriate types for multiprecision integer stuff. + * $Id: mptypes.c,v 1.2 1999/11/13 01:54:32 mdw Exp $ + * + * Generate `mptypes.h' header file for current architecture + * + * (c) 1999 Straylight/Edgeware + */ + +/*----- Licensing notice --------------------------------------------------* + * + * This file is part of Catacomb. + * + * Catacomb is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * Catacomb is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with Catacomb; if not, write to the Free + * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. */ +/*----- Revision history --------------------------------------------------* + * + * $Log: mptypes.c,v $ + * Revision 1.2 1999/11/13 01:54:32 mdw + * Format source code properly ;-). Attach suffixes to the `max' + * constants. + * + */ + +/*----- Header files ------------------------------------------------------*/ + #define _GNU_SOURCE #include #include @@ -10,6 +45,8 @@ # include #endif +/*----- Data types --------------------------------------------------------*/ + /* --- Hack for GCC --- * * * WG14 in their infinite wisdom decided not to use the GCC constant name. @@ -43,25 +80,26 @@ enum { struct itype { const char *name; + const char *suff; umax max; unsigned flags; unsigned bits; } tytab[] = { - { "unsigned int", UINT_MAX, 0 }, - { "unsigned short", USHRT_MAX, 0 }, - { "unsigned long", ULONG_MAX, 0 }, + { "unsigned int", "u", UINT_MAX, 0 }, + { "unsigned short", "u", USHRT_MAX, 0 }, + { "unsigned long", "ul", ULONG_MAX, 0 }, #ifdef ULLONG_MAX - { "unsigned long long", ULLONG_MAX, 0 }, + { "unsigned long long", "ull", ULLONG_MAX, 0 }, #endif #ifdef UINTMAX_MAX - { "uintmax_t", UINTMAX_MAX, f_stdint }, + { "uintmax_t", "u", UINTMAX_MAX, f_stdint }, #endif { 0, 0 }, }; typedef struct itype itype; -/* --- Main program --- */ +/*----- Main code ---------------------------------------------------------*/ int main(int argc, char *argv[]) { @@ -129,16 +167,17 @@ int main(int argc, char *argv[]) printf("\ typedef %s mpw;\n\ #define MPW_BITS %u\n\ -#define MPW_MAX " P_UMAX "\n\ +#define MPW_MAX " P_UMAX "%s\n\ \n\ typedef %s mpd;\n\ #define MPD_BITS %u\n\ -#define MPD_MAX " P_UMAX "\n\ +#define MPD_MAX " P_UMAX "%s\n\ \n\ #endif\n\ ", - mpw->name, mpw->bits, mpw->max, - mpd->name, mpd->bits, mpd->max); + mpw->name, mpw->bits, mpw->max, mpw->suff, + mpd->name, mpd->bits, mpd->max, mpd->suff); return (0); } +/*----- That's all, folks -------------------------------------------------*/ -- 2.11.0