#endif
#endif
+#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <setjmp.h>
return new;
}
-Gwidget_t *findwidget (unsigned long w, int type) {
+Gwidget_t *findwidget (uint64_t w, int type) {
int wi;
if (type == G_WTYPESIZE) {
for (wi = 0; wi < Gwidgetn; wi++)
- if (Gwidgets[wi].inuse && (unsigned long) Gwidgets[wi].w == w)
+ if (Gwidgets[wi].inuse && (uint64_t) Gwidgets[wi].w == w)
return &Gwidgets[wi];
} else {
for (wi = 0; wi < Gwidgetn; wi++)
if (
Gwidgets[wi].inuse && Gwidgets[wi].type == type &&
- (unsigned long) Gwidgets[wi].w == w
+ (uint64_t) Gwidgets[wi].w == w
)
return &Gwidgets[wi];
}
Grect_t r;
Gcolor_t c;
void *func;
- unsigned long u;
+ uint64_t u;
} u;
} Gwattr_t;
typedef struct Gwlist_t {
Gtw_t *t;
Gvw_t *v;
} u;
- unsigned long udata;
+ uint64_t udata;
} Gwidget_t;
#define WIDGETINCR 20
#define WIDGETSIZE sizeof (Gwidget_t)
void Gawdefcoordscb (int, Gawdata_t *);
Gwidget_t *newwidget (int);
-Gwidget_t *findwidget (unsigned long, int);
+Gwidget_t *findwidget (uint64_t, int);
Gbitmap_t *newbitmap (void);
void Gerr (char *, int, int, ...);
gfxrect_t **rp;
gfxrect_t *crp;
- rp = &gfxnodes[ni].rect[(unsigned long) ko % LISTSIZE];
+ rp = &gfxnodes[ni].rect[(uint64_t) ko % LISTSIZE];
for (crp = *rp; crp; crp = crp->next)
if (crp->ko == ko) {
crp->r.o.x = min (r.o.x, r.c.x);
gfxrect_t **rp;
gfxrect_t *crp;
- rp = &gfxnodes[ni].rect[(unsigned long) ko % LISTSIZE];
+ rp = &gfxnodes[ni].rect[(uint64_t) ko % LISTSIZE];
for (crp = *rp; crp; crp = crp->next)
if (crp->ko == ko) {
crp->r.o.x = min (crp->r.o.x, min (r.o.x, r.c.x));
gfxrect_t **rp;
gfxrect_t *crp, *prp;
- rp = &gfxnodes[ni].rect[(unsigned long) ko % LISTSIZE];
+ rp = &gfxnodes[ni].rect[(uint64_t) ko % LISTSIZE];
for (crp = *rp, prp = NULL; crp; prp = crp, crp = crp->next)
if (crp->ko == ko) {
if (crp == *rp)
gfxmenu_t **mp;
gfxmenu_t *cmp;
- mp = &gfxnodes[ni].menu[(unsigned long) ko % LISTSIZE];
+ mp = &gfxnodes[ni].menu[(uint64_t) ko % LISTSIZE];
for (cmp = *mp; cmp; cmp = cmp->next)
if (cmp->ko == ko) {
cmp->time = time, cmp->mi = mi;
gfxmenu_t **mp;
gfxmenu_t *cmp;
- mp = &gfxnodes[ni].menu[(unsigned long) ko % LISTSIZE];
+ mp = &gfxnodes[ni].menu[(uint64_t) ko % LISTSIZE];
for (cmp = *mp; cmp; cmp = cmp->next)
if (cmp->ko == ko && cmp->time == time)
return cmp->mi;
T_ISSTRING (ko) && strcmp (((Tstring_t *) (ko))->s, (sk)) == 0 \
)
-#define GETIKINDEX(tp, ik) (unsigned long) ik % tp->ln
-#define GETRKINDEX(tp, rk) (unsigned long) rk % tp->ln
-#define GETSKINDEX(tp, sk) (unsigned long) *sk % tp->ln
+#define GETIKINDEX(tp, ik) (uint64_t) ik % tp->ln
+#define GETRKINDEX(tp, rk) (uint64_t) rk % tp->ln
+#define GETSKINDEX(tp, sk) (uint64_t) *sk % tp->ln
typedef struct mapentry_t {
struct mapentry_t *next;
mapentry_t **lp;
mapentry_t *cep;
- lp = &map.list[(unsigned long) fmo % MAPLISTN];
+ lp = &map.list[(uint64_t) fmo % MAPLISTN];
if (!(cep = Mallocate (MAPENTRYSIZE)))
panic1 (POS, "mapinsert", "cannot allocate mapentry");
cep->fmo = fmo, cep->too = too;
mapentry_t **lp;
mapentry_t *cep;
- lp = &map.list[(unsigned long) fmo % MAPLISTN];
+ lp = &map.list[(uint64_t) fmo % MAPLISTN];
for (cep = *lp; cep; cep = cep->next)
if (cep->fmo == fmo)
return cep->too;
case TXT_SEEN:
cnode->u.s.text = Sseen (cnode->ko, cnode->u.s.txtnode->path);
buttondata[3].u.t = cnode->u.s.text;
- buttondata[4].u.u = (unsigned long) cnode->vo;
+ buttondata[4].u.u = (uint64_t) cnode->vo;
cnode->u.s.wi = Gcreatewidget (
pnode->u.f.t.mwi, G_BUTTONWIDGET, 5, &buttondata[0]
);
case TXT_ABSTRACT:
cnode->u.a.text = Sabstract (cnode->ko, cnode->vo);
buttondata[3].u.t = cnode->u.a.text;
- buttondata[4].u.u = (unsigned long) cnode->vo;
+ buttondata[4].u.u = (uint64_t) cnode->vo;
cnode->u.a.wi = Gcreatewidget (
pnode->u.f.t.mwi, G_BUTTONWIDGET, 5, &buttondata[0]
);
cnode->u.f.t.ftext = Stfull (cnode->ko);
cnode->u.f.t.ltext = "];";
buttondata[3].u.t = cnode->u.f.t.ftext;
- buttondata[4].u.u = (unsigned long) cnode->vo;
+ buttondata[4].u.u = (uint64_t) cnode->vo;
cnode->u.f.t.fwi = Gcreatewidget (
pnode->u.f.t.mwi, G_BUTTONWIDGET, 5, &buttondata[0]
);
pnode->u.f.t.mwi, G_ARRAYWIDGET, 2, &arraydata[0]
);
buttondata[3].u.t = cnode->u.f.t.ltext;
- buttondata[4].u.u = (unsigned long) cnode->vo;
+ buttondata[4].u.u = (uint64_t) cnode->vo;
cnode->u.f.t.lwi = Gcreatewidget (
pnode->u.f.t.mwi, G_BUTTONWIDGET, 5, &buttondata[0]
);
} else {
cnode->u.f.s.text = Ssfull (cnode->ko, cnode->vo);
buttondata[3].u.t = cnode->u.f.s.text;
- buttondata[4].u.u = (unsigned long) cnode->vo;
+ buttondata[4].u.u = (uint64_t) cnode->vo;
cnode->u.f.s.wi = Gcreatewidget (
pnode->u.f.t.mwi, G_BUTTONWIDGET, 5, &buttondata[0]
);
gml2gv_SOURCES = gml2gv.c gmlparse.y gmlscan.l
gmlparse.c: y.tab.c
- @SED@ "s/yy/gml/g" < y.tab.c > gmlparse.c
+ @SED@ "s/yy/gml/g" < y.tab.c | \
+ @SED@ "s/unsigned long int/uint64_t/g" | \
+ @SED@ "s/unsigned long/uint64_t/g" > gmlparse.c
gmlparse.h: y.tab.h
- @SED@ "s/yy/gml/g" < y.tab.h > gmlparse.h
+ @SED@ "s/yy/gml/g" < y.tab.h | \
+ @SED@ "s/unsigned long int/uint64_t/g" | \
+ @SED@ "s/unsigned long/uint64_t/g" > gmlparse.h
y.tab.c y.tab.h : y.output
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <inttypes.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
static FILE *outFile;
static char *CmdName;
static char **Files;
-static unsigned long id;
+static uint64_t id;
#define streq(s,t) (!strcmp(s,t))
typedef struct Agnodeinfo_t {
Agrec_t h;
- unsigned long id;
+ uint64_t id;
} Agnodeinfo_t;
#define ID(n) (((Agnodeinfo_t*)(n->base.data))->id)
static void
emitEdge (Agraph_t* G, Agedge_t* e, FILE* outFile)
{
- fprintf (outFile, " edge [\n id %lu\n", (unsigned long)AGSEQ(e));
+ fprintf (outFile, " edge [\n id %lu\n", (uint64_t)AGSEQ(e));
fprintf (outFile, " source %lu\n", ID(agtail(e)));
fprintf (outFile, " target %lu\n", ID(aghead(e)));
emitEdgeAttrs (G, e, outFile, 2);
#include <stdio.h>
#include <stdlib.h>
+#include <inttypes.h>
#include <errno.h>
#include <generic_list.h>
#define DFLT_SIZE 100
-generic_list_t *new_generic_list(unsigned long size)
+generic_list_t *new_generic_list(uint64_t size)
{
generic_list_t *list;
generic_list_t *add_to_generic_list(generic_list_t * list, gl_data element)
{
- unsigned long new_size;
+ uint64_t new_size;
gl_data *new_data;
if (list->size == list->used) {
typedef void *gl_data;
typedef struct generic_list_s {
- unsigned long used; /* number of elements in the list */
- unsigned long size; /* number of elements that the list can hold */
+ uint64_t used; /* number of elements in the list */
+ uint64_t size; /* number of elements that the list can hold */
gl_data *data; /* pointer to first element */
} generic_list_t;
- extern generic_list_t *new_generic_list(unsigned long size);
+ extern generic_list_t *new_generic_list(uint64_t size);
extern generic_list_t *add_to_generic_list(generic_list_t * list,
gl_data element);
extern void free_generic_list(generic_list_t * list);
rm @LEX_OUTPUT_ROOT@.c
grammar.c: y.tab.c
- @SED@ "s/yy/aag/g" < y.tab.c > grammar.c
+ @SED@ "s/yy/aag/g" < y.tab.c | \
+ @SED@ "s/unsigned long int/uint64_t/g" | \
+ @SED@ "s/unsigned long/uint64_t/g" > grammar.c
grammar.h: y.tab.h
- @SED@ "s/yy/aag/g" < y.tab.h > grammar.h
+ @SED@ "s/yy/aag/g" < y.tab.h | \
+ @SED@ "s/unsigned long int/uint64_t/g" | \
+ @SED@ "s/unsigned long/uint64_t/g" > grammar.h
y.tab.c y.tab.h: y.output
int agedgecmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc);
int agnamecmpf(Dict_t * d, void *, void *, Dtdisc_t * disc);
void agset_node_disc(Agraph_t * g, Dtdisc_t * disc);
-unsigned long agnextseq(Agraph_t * g, int objtype);
+uint64_t agnextseq(Agraph_t * g, int objtype);
/* dict helper functions */
Dict_t *agdtopen(Agraph_t * g, Dtdisc_t * disc, Dtmethod_t * method);
#ifndef ATT_GRAPH_H
#define ATT_GRAPH_H
-#include "cdt.h"
+#include <inttypes.h>
+#include "cdt.h"
#ifdef __cplusplus
extern "C" {
#define NILedge NIL(Agedge_t*)
#define NILsym NIL(Agsym_t*)
-#if 0
-// FIXME - I didn't understand this comment about Win64.
-// - What is that loss?
-// - Do we ever cast a pointer to an IDTYPE in graphviz?
-// - Is uintptr_t is available on all architectures/compilers?
-
-/* avoid loss when casting pointer to unsigned long on Win64 */
-typedef uintptr_t IDTYPE;
-#else
-typedef unsigned long IDTYPE;
-#endif
+typedef uint64_t IDTYPE;
/* forward struct type declarations */
typedef struct Agtag_s Agtag_t;
Agdisc_t disc; /* resource discipline functions */
Agdstate_t state; /* resource closures */
Dict_t *strdict; /* shared string dict */
- unsigned long seq[3]; /* local object sequence number counter */
+ uint64_t seq[3]; /* local object sequence number counter */
Agcbstack_t *cb; /* user and system callback function stacks */
unsigned char callbacks_enabled; /* issue user callbacks or hold them? */
Dict_t *lookup_by_name[3];
static Agedge_t *agfindedge_by_name(Agraph_t * g, Agnode_t * t,
Agnode_t * h, char *name)
{
- unsigned long id;
+ uint64_t id;
if (agmapnametoid(agraphof(t), AGEDGE, name, &id, FALSE))
return agfindedge_by_id(g, t, h, id);
return SUCCESS;
}
-unsigned long agnextseq(Agraph_t * g, int objtype)
+uint64_t agnextseq(Agraph_t * g, int objtype)
{
return ++(g->clos->seq[objtype]);
}
/* internal node constructor */
-static Agnode_t *newnode(Agraph_t * g, IDTYPE id, unsigned long seq)
+static Agnode_t *newnode(Agraph_t * g, IDTYPE id, uint64_t seq)
{
Agnode_t *n;
static void dict_relabel(Agnode_t * n, void *arg)
{
Agraph_t *g;
- unsigned long new_id;
+ uint64_t new_id;
g = agraphof(n);
- new_id = *(unsigned long *) arg;
+ new_id = *(uint64_t *) arg;
dtdelete(g->n_id, n); /* wrong, should be subrep */
AGID(n) = new_id;
dtinsert(g->n_id, n); /* also wrong */
static Dtdisc_t Disc = {
offsetof(pending_cb_t, key), /* sort by 'key' */
- sizeof(unsigned long),
+ sizeof(uint64_t),
0, /* link offset */
NIL(Dtmake_f),
freef,
* reference counted strings.
*/
-static unsigned long HTML_BIT; /* msbit of unsigned long */
-static unsigned long CNT_BITS; /* complement of HTML_BIT */
+static uint64_t HTML_BIT; /* msbit of uint64_t */
+static uint64_t CNT_BITS; /* complement of HTML_BIT */
typedef struct refstr_t {
Dtlink_t link;
- unsigned long refcnt;
+ uint64_t refcnt;
char *s;
char store[1]; /* this is actually a dynamic array */
} refstr_t;
}
static int has_no_predecessor_below(Agraph_t * g, Agnode_t * n,
- unsigned long val)
+ uint64_t val)
{
Agedge_t *e;
* or has non-default attributes.
*/
static int write_node_test(Agraph_t * g, Agnode_t * n,
- unsigned long pred_id)
+ uint64_t pred_id)
{
if (NOT(node_in_subg(g, n)) && has_no_predecessor_below(g, n, pred_id)) {
if (has_no_edges(g, n) || not_default_attrs(g, n))
htmlparse.o htmlparse.lo: htmlparse.c htmlparse.h
htmlparse.c: y.tab.c
- @SED@ "s/yy/html/g" < y.tab.c > htmlparse.c
+ @SED@ "s/yy/html/g" < y.tab.c | \
+ @SED@ "s/unsigned long int/uint64_t/g" | \
+ @SED@ "s/unsigned long/uint64_t/g" > htmlparse.c
htmlparse.h: y.tab.h
- @SED@ "s/yy/html/g" < y.tab.h > htmlparse.h
+ @SED@ "s/yy/html/g" < y.tab.h | \
+ @SED@ "s/unsigned long int/uint64_t/g" | \
+ @SED@ "s/unsigned long/uint64_t/g"> htmlparse.h
y.tab.c y.tab.h: y.output
if (ND_onstack(w)) {
dump_graph (g);
fprintf(stderr, "cycle: last edge %lx %s(%lx) %s(%lx)\n",
- (unsigned long int)e,
- agnameof(n), (unsigned long int)n,
- agnameof(w), (unsigned long int)w);
+ (uint64_t)e,
+ agnameof(n), (uint64_t)n,
+ agnameof(w), (uint64_t)w);
return w;
}
else {
x = checkdfs(g, w);
if (x) {
fprintf(stderr,"unwind %lx %s(%lx)\n",
- (unsigned long int)e,
- agnameof(n), (unsigned long int)n);
+ (uint64_t)e,
+ agnameof(n), (uint64_t)n);
if (x != n) return x;
fprintf(stderr,"unwound to root\n");
fflush(stderr);
#include <string.h>
#endif
+#include <inttypes.h>
+
#include "types.h"
#include "macros.h"
#include "const.h"
static int printfn(Dict_t *dict, void *arg, void *data)
{
repkey_t *rk = arg;
- printf("%lx=>%d,%lx\n",(long unsigned int)(rk->key),rk->val.type,(long unsigned int)(rk->val.p));
+ printf("%lx=>%d,%lx\n",(uint64_t)(rk->key),rk->val.type,(uint64_t)(rk->val.p));
return 0;
}
static void dumpdict(Agraph_t *model)
exparse.c: y.tab.c
@SED@ "s/yy/ex/g" <y.tab.c | \
@SED@ "s/YY/EX/g" | \
+ @SED@ "s/unsigned long int/uint64_t/g" | \
+ @SED@ "s/unsigned long/uint64_t/g" | \
@SED@ "s/fprintf/sfprintf/g" | \
@SED@ "s/FILE/Sfio_t/g" | \
@SED@ "s/stderr/sfstderr/g" > exparse.c
exparse.h: y.tab.h
echo "#ifndef _EXPARSE_H" > exparse.h
echo "#define _EXPARSE_H" >> exparse.h
- @SED@ "s/yy/ex/g" < y.tab.h | @SED@ "s/YY/EX/g" >> exparse.h
+ @SED@ "s/yy/ex/g" < y.tab.h | \
+ @SED@ "s/unsigned long int/uint64_t/g" | \
+ @SED@ "s/unsigned long/uint64_t/g" | \
+ @SED@ "s/YY/EX/g" >> exparse.h
echo "#endif /* _EXPARSE_H */" >> exparse.h
y.tab.c y.tab.h: y.output
#define _EXPR_H
#include <ast.h>
+#include <inttypes.h>
#undef RS /* hp.pa <signal.h> grabs this!! */
typedef struct Exbuf_s /* sized buffer */
{
- unsigned long size; /* buffer size */
+ uint64_t size; /* buffer size */
char* data; /* buffer data */
} Exbuf_t;
struct Exdisc_s /* discipline */
{
- unsigned long version; /* EX_VERSION */
- unsigned long flags; /* EX_* flags */
+ uint64_t version; /* EX_VERSION */
+ uint64_t flags; /* EX_* flags */
Exid_t* symbols; /* static symbols */
char** data; /* compiled function arg data */
char* lib; /* pathfind() lib */
{
Sfio_t* text; /* text output stream */
char* id; /* symbol prefix */
- unsigned long flags; /* EXCC_* flags */
+ uint64_t flags; /* EXCC_* flags */
int (*ccf)(Excc_t*, Exnode_t*, Exid_t*, Exref_t*, Exnode_t*, Exccdisc_t*);
/* program generator function */
};
#include <values.h>
#endif
#endif
+#include <inttypes.h>
#include <assert.h>
#include "tlayout.h"
#include "neatoprocs.h"
len += strlen(agnameof(g)) + strlen(agnameof(h)) + strlen(agnameof(t));
if (len >= BSZ)
sprintf(buf, "_port_%s_%s_%s_%ld", agnameof(g), agnameof(t), agnameof(h),
- (unsigned long)AGSEQ(e));
+ (uint64_t)AGSEQ(e));
else
sprintf(buf, "_port_%s_(%d)_(%d)_%ld",agnameof(g), ND_id(t), ND_id(h),
- (unsigned long)AGSEQ(e));
+ (uint64_t)AGSEQ(e));
return buf;
}
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
+#include <inttypes.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
static z_stream z_strm;
static unsigned char *df;
static unsigned int dfallocated;
-static unsigned long int crc;
+static uint64_t crc;
#endif /* HAVE_LIBZ */
#include "const.h"
typedef struct inkpot_values_s {
#if 0
/* FIXME - not sure about all this ... */
- unsigned long * named[SZT_VTYPE];
- unsigned long * unnamed[SZT_VTYPE];
- unsigned long * palette[SZT_VTYPE];
+ uint64_t * named[SZT_VTYPE];
+ uint64_t * unnamed[SZT_VTYPE];
+ uint64_t * palette[SZT_VTYPE];
size_t named_64_size[SZT_VTYPE];
size_t named_48_size[SZT_VTYPE];
size_t named_32_size[SZT_VTYPE];
#define _BLD_sfio 1
#endif
+#include <inttypes.h>
+
/* Internal definitions for sfio.
** Written by Kiem-Phong Vo
*/
#define uchar unsigned char
#endif
#ifndef ulong
-#define ulong unsigned long
+#define ulong uint64_t
#endif
#ifndef uint
#define uint unsigned int
int validQ_int_string(char *to_convert, int *v){
/* check to see if this is a string is integer */
char *p = to_convert;
- unsigned long val;
+ uint64_t val;
errno = 0;
val = strtoul(to_convert, &p, 10);
if (errno != 0 ||// conversion failed (EINVAL, ERANGE)
#endif
typedef struct {
- unsigned long nStepsToLeaf;
- unsigned long subtreeSize;
- unsigned long nChildren;
- unsigned long nStepsToCenter;
+ uint64_t nStepsToLeaf;
+ uint64_t subtreeSize;
+ uint64_t nChildren;
+ uint64_t nStepsToCenter;
node_t *parent;
double span;
double theta;
#include <io.h>
#endif
+#include <inttypes.h>
+
/* Common types, and macros for vmalloc functions.
**
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
#undef BITS
typedef unsigned char Vmuchar_t;
- typedef unsigned long Vmulong_t;
+ typedef uint64_t Vmulong_t;
typedef union _head_u Head_t;
typedef union _body_u Body_t;
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
+#include <inttypes.h>
#include "macros.h"
#include "const.h"
int len, pos = 0;
int temp,cnt,remaining=0;
char workstr[16];
- long unsigned int charnum=0;
+ uint64_t charnum=0;
unsigned char byte;
unsigned char mask;
#endif
#include <stdio.h>
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
+#include <inttypes.h>
#include <unistd.h>
-#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
typedef struct window_glitz_s {
Window win;
- unsigned long event_mask;
+ uint64_t event_mask;
Pixmap pix;
GC gc;
Visual *visual;
XWMHints *wmhints;
XSizeHints *normalhints;
XClassHint *classhint;
- unsigned long attributemask = 0;
+ uint64_t attributemask = 0;
char *name;
window_t *window;
#endif
#include <stdio.h>
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
+#include <inttypes.h>
#include <unistd.h>
-#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
typedef struct window_xlib_s {
Window win;
- unsigned long event_mask;
+ uint64_t event_mask;
Pixmap pix;
GC gc;
Visual *visual;
XWMHints *wmhints;
XSizeHints *normalhints;
XClassHint *classhint;
- unsigned long attributemask = 0;
+ uint64_t attributemask = 0;
char *name;
window_t *window;
int w, h;
gctx->ictx = ictx;
return (void *)gctx;
}
-static long myiddisc_map(void *state, int objtype, char *str, unsigned long *id, int createflag) {
+static long myiddisc_map(void *state, int objtype, char *str, uint64_t *id, int createflag) {
gctx_t *gctx = (gctx_t *)state;
ictx_t *ictx = gctx->ictx;
char *s;
s = agstrdup(gctx->g, str);
else
s = agstrbind(gctx->g, str);
- *id = (unsigned long) s;
+ *id = (uint64_t) s;
} else {
*id = ictx->ctr; /* counter maintained in per-interp space, so that
ids are unique across all graphs in the interp */
return TRUE;
}
/* we don't allow users to explicitly set IDs, either */
-static long myiddisc_alloc(void *state, int objtype, unsigned long request_id) {
+static long myiddisc_alloc(void *state, int objtype, uint64_t request_id) {
NOTUSED(state);
NOTUSED(objtype);
NOTUSED(request_id);
return FALSE;
}
-static void myiddisc_free(void *state, int objtype, unsigned long id) {
+static void myiddisc_free(void *state, int objtype, uint64_t id) {
gctx_t *gctx = (gctx_t *)state;
/* FIXME no obj* available
if (id % 2 == 0)
agstrfree(gctx->g, (char *) id);
}
-static char *myiddisc_print(void *state, int objtype, unsigned long id) {
+static char *myiddisc_print(void *state, int objtype, uint64_t id) {
NOTUSED(state);
NOTUSED(objtype);
if (id % 2 == 0)
typedef struct {
Agdisc_t mydisc; /* must be first to allow casting mydisc to ictx */
Agiodisc_t myioDisc;
- unsigned long ctr; /* odd number counter for anon objects over all g's in interp */
+ uint64_t ctr; /* odd number counter for anon objects over all g's in interp */
Tcl_Interp *interp;
GVC_t *gvc;
} ictx_t;
typedef struct {
Agraph_t *g; /* the graph */
ictx_t *ictx;
- unsigned long idx;
+ uint64_t idx;
} gctx_t;
#if HAVE_LIBGD
#include <stdlib.h>
#include <stdio.h>
+#include <inttypes.h>
#include "tclhandle.h"
/* Added 2000-09-19 by KG for memcpy, ... decls */
#include <string.h>
*-----------------------------------------------------------------------------
*/
entryHeader_pt tclhandleAlloc(tblHeader_pt headerPtr, char *handle,
- unsigned long *entryIdxPtr)
+ uint64_t *entryIdxPtr)
{
tblHeader_pt tblHdrPtr = (tblHeader_pt) headerPtr;
entryHeader_pt entryPtr;
*/
if (tclhandleEntryAlignment == 0) {
tclhandleEntryAlignment = sizeof(void *);
- if (sizeof(unsigned long) > tclhandleEntryAlignment)
- tclhandleEntryAlignment = sizeof(unsigned long);
+ if (sizeof(uint64_t) > tclhandleEntryAlignment)
+ tclhandleEntryAlignment = sizeof(uint64_t);
if (sizeof(double) > tclhandleEntryAlignment)
tclhandleEntryAlignment = sizeof(double);
}
*-----------------------------------------------------------------------------
*/
int tclhandleIndex(tblHeader_pt tblHdrPtr, char *handle,
- unsigned long *entryIdxPtr)
+ uint64_t *entryIdxPtr)
{
- unsigned long entryIdx;
+ uint64_t entryIdx;
if ((sscanf(handle, tblHdrPtr->handleFormat, &entryIdx)) != 1)
return TCL_ERROR;
*-----------------------------------------------------------------------------
*/
void tclhandleString(tblHeader_pt tblHdrPtr, char *handle,
- unsigned long entryIdx)
+ uint64_t entryIdx)
{
sprintf(handle, tblHdrPtr->handleFormat, entryIdx);
}
* A pointer to the entry, or NULL if an error occured.
*-----------------------------------------------------------------------------
*/
-void *tclhandleXlateIndex(tblHeader_pt headerPtr, unsigned long entryIdx)
+void *tclhandleXlateIndex(tblHeader_pt headerPtr, uint64_t entryIdx)
{
tblHeader_pt tblHdrPtr = headerPtr;
entryHeader_pt entryPtr;
*/
void *tclhandleXlate(tblHeader_pt tblHdrPtr, char *handle)
{
- unsigned long entryIdx;
+ uint64_t entryIdx;
if ((tclhandleIndex(tblHdrPtr, handle, &entryIdx)) != TCL_OK)
return NULL;
* The contents of the entry, if success, or NULL if an error occured.
*----------------------------------------------------------------------------
*/
-void *tclhandleFreeIndex(tblHeader_pt headerPtr, unsigned long entryIdx)
+void *tclhandleFreeIndex(tblHeader_pt headerPtr, uint64_t entryIdx)
{
tblHeader_pt tblHdrPtr = headerPtr;
entryHeader_pt entryPtr, freeentryPtr;
*/
void *tclhandleFree(tblHeader_pt tblHdrPtr, char *handle)
{
- unsigned long entryIdx;
+ uint64_t entryIdx;
if ((tclhandleIndex(tblHdrPtr, handle, &entryIdx)) != TCL_OK)
return NULL;
* **** This macro provides no checks *****
*/
#define TBL_ENTRY(hdrPtr, entryPtr) \
- ((unsigned long) ((entryPtr - (hdrPtr->bodyPtr)) / (hdrPtr->entrySize)))
+ ((uint64_t) ((entryPtr - (hdrPtr->bodyPtr)) / (hdrPtr->entrySize)))
/*
* This macros to convert between pointers to the user and header area of
*/
void *tclhandleFreeIndex(tblHeader_pt headerPtr,
- unsigned long entryIdx);
+ uint64_t entryIdx);
void *tclhandleFree(tblHeader_pt headerPtr, char *handle);
tblHeader_pt tclhandleInit(char *prefix, int entrySize,
int initEntries);
int tclhandleReset(tblHeader_pt tblHdrPtr, int initEntries);
int tclhandleDestroy(tblHeader_pt tblHdrPtr);
void *tclhandleXlateIndex(tblHeader_pt headerPtr,
- unsigned long entryIdx);
+ uint64_t entryIdx);
void *tclhandleXlate(tblHeader_pt headerPtr, char *handle);
entryHeader_pt tclhandleAlloc(tblHeader_pt tblHdrPtr, char *handle,
- unsigned long *entryIdxPtr);
+ uint64_t *entryIdxPtr);
void tclhandleString(tblHeader_pt tblHdrPtr, char *handle,
- unsigned long entryIdx);
+ uint64_t entryIdx);
int tclhandleIndex(tblHeader_pt tblHdrPtr, char *handle,
- unsigned long *entryIdxPtr);
+ uint64_t *entryIdxPtr);
#ifdef __cplusplus
}
#include <unistd.h>
#endif
+#include <inttypes.h>
#include <assert.h>
#include <math.h>
#include <pathutil.h>
if (vgp->triangle_cmd) {
sprintf(vbuf, "vgpane%lu",
- (unsigned long) (((ubyte_pt) vgp - (vgpaneTable->bodyPtr))
+ (uint64_t) (((ubyte_pt) vgp - (vgpaneTable->bodyPtr))
/ (vgpaneTable->entrySize)));
expandPercentsEval(vgp->interp, vgp->triangle_cmd, vbuf, 3, pqr);
}