/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2014,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
/*
Version Control
- $Id: gen.c,v 1.68 2014/05/24 21:34:53 tom Exp $
+ $Id: gen.c,v 1.72 2020/02/22 21:01:00 tom Exp $
--------------------------------------------------------------------------*/
/*
This program prints on its standard output the source for the
else /* or */
bit = ~offset; /* 7 - offset */
bit &= 7; /* modulo 8 */
- return byte & (UCHAR) (1 << bit);
+ return (UCHAR) (byte & (1 << bit));
}
/* Find lowest and highest used offset in a byte array. */
UINT first, last; \
record mask; \
memset (&mask, 0, sizeof (mask)); \
- mask.field = -1; \
+ memset (&mask.field, 0xff, sizeof(mask.field)); \
if (!find_pos ((UCHAR *)&mask, sizeof (mask), &first, &last)) \
my_error ("failed to locate" #record "_" #field); \
print_constant (#record "_" #field "_First", first); \
if (argc != 2)
my_error("Only one argument expected (DFT_ARG_SUFFIX)");
- printf("-- Generated by the C program %s (source " __FILE__ ").\n",
- my_program_invocation_name);
+ if ((strlen(argv[0]) + strlen(__FILE__)) > 25)
+ {
+ printf("-- Generated by the C program %.40s.\n",
+ my_program_invocation_name);
+ }
+ else
+ {
+ printf("-- Generated by the C program %s (source %s).\n",
+ my_program_invocation_name,
+ __FILE__);
+ }
printf("-- Do not edit this file directly.\n");
printf("-- The values provided here may vary on your system.\n");
printf("\n");