PutAuxFile(auxfp)
FILE* auxfp;
{
- intish i;
+ int i;
fprintf(auxfp, "X_RANGE %.2f\n", xrange);
fprintf(auxfp, "Y_RANGE %.2f\n", yrange);
switch (unit) {
case MEGABYTE :
fprintf(psfp, "(");
- CommaPrint(psfp, (int) (num / 1e6 + 0.5));
+ CommaPrint(psfp, (intish) (num / 1e6 + 0.5));
fprintf(psfp, "M)\n");
break;
case KILOBYTE :
fprintf(psfp, "(");
- CommaPrint(psfp, (int) (num / 1e3 + 0.5));
+ CommaPrint(psfp, (intish) (num / 1e3 + 0.5));
fprintf(psfp, "k)\n");
break;
case BYTE:
fprintf(psfp, "(");
- CommaPrint(psfp, (int) (num + 0.5));
+ CommaPrint(psfp, (intish) (num + 0.5));
fprintf(psfp, ")\n");
break;
}
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include "Main.h"
#include "Defines.h"
#include "AuxFile.h"
#include "Error.h"
#include "Utilities.h"
-#ifndef atof
-double atof PROTO((char *));
-#endif
-
boolish pflag = 0; /* read auxiliary file */
boolish eflag = 0; /* scaled EPSF */
boolish dflag = 0; /* sort by standard deviation */
#ifndef MAIN_H
#define MAIN_H
+#include "config.h"
+
#ifdef __STDC__
#define PROTO(x) x
#else
*/
typedef double floatish;
typedef double doublish; /* higher precision, if anything; little used */
-typedef long intish;
typedef int boolish;
+/* Use "long long" if we have it: the numbers in profiles can easily
+ * overflow 32 bits after a few seconds execution.
+ */
+#ifdef HAVE_LONG_LONG
+typedef long long int intish;
+#else
+typedef long int intish;
+#endif
+
extern intish nsamples;
extern intish nmarks;
extern intish nidents;
TOP=../..
include $(TOP)/mk/boilerplate.mk
-C_SRCS = $(wildcard *.c)
-H_SRCS = $(wildcard *.h)
C_PROG = hp2ps
+SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -Wall
+
INSTALL_PROGS += $(C_PROG)
LIBS = $(LIBM)
fprintf(psfp, "HE%d setfont\n", TITLE_TEXT_FONT);
fprintf(psfp, "%f %f moveto\n", x, y);
fputc('(', psfp);
- CommaPrint(psfp, (int) areabelow);
+ CommaPrint(psfp, (intish)areabelow);
fprintf(psfp, " %s x %s)\n", valueunitstring, sampleunitstring);
fprintf(psfp, "show\n");
fprintf(psfp, "HE%d setfont\n", TITLE_TEXT_FONT);
fputc('(', psfp);
- CommaPrint(psfp, (int) areabelow);
+ CommaPrint(psfp, (intish) areabelow);
fprintf(psfp, " %s x %s)\n", valueunitstring, sampleunitstring);
fprintf(psfp, "dup stringwidth pop\n");
{
static int thisshade = -1;
- floatish x;
-
thisshade++;
return cflag ?
c_shades[ thisshade % N_COLOUR_SHADES ] :
void
CommaPrint(fp,n)
FILE* fp;
- int n;
+ intish n;
{
if (n < ONETHOUSAND) {
- fprintf(fp, "%d", n);
+ fprintf(fp, "%d", (int)n);
} else {
CommaPrint(fp, n / ONETHOUSAND);
- fprintf(fp, ",%03d", n % ONETHOUSAND);
+ fprintf(fp, ",%03d", (int)n % ONETHOUSAND);
}
}
char* Basename PROTO((char *));
void DropSuffix PROTO((char *, char *));
FILE* OpenFile PROTO((char *, char *));
-void CommaPrint PROTO((FILE *, int));
+void CommaPrint PROTO((FILE *, intish));
char *copystring PROTO((char *));
char *copystring2 PROTO((char *, char *));
void *xmalloc PROTO((int));