The attached diff.log (diff -C -r) file contains a diff between a
snaphost of the CVS tree, and my local developement tree, which has
various fixes for warnings that turned up while building on Win2k
(Visual C++ 6.0). Virtually all of the changes are casts or
like constructs, just to shut the warnings up.
The changes to the win/makefile were needed on my particular
environment (TclPro 1.4 install). I'm not sure you want to
include these in the standard distro, as some of their layout
(such as the location of tcl83.lib) seems non-standard. Other
changes in this file were to deal with the fact that a standard
install of Visual C++ installs it under "C:\Program Files" - the
directories contain spaces. This causes all kinds of problems,
so I assumed that the compiler was in the PATH, and that it knows
how to find the standard include files (so no explicit -I needed).
Also, TclPro does not seem to include tclIntPlatDecls.h. I couldn't
find this on my Linux install either. But various resources on the
web have it. So, I added some extern decls to work around the
problem.
Let me know if there are any questions. Now, off to work on
tnmWinInit problems...
Pete
diff -C 3 -r -w scotty-cvs/tkined/generic/tkiBarchart.c scotty-my/tkined/generic/tkiBarchart.c
*** scotty-cvs/tkined/generic/tkiBarchart.c Mon Aug 14 10:03:23 2000
--- scotty-my/tkined/generic/tkiBarchart.c Thu Nov 15 11:08:04 2001
***************
*** 14,19 ****
--- 14,20 ----
#include <stdio.h>
#include <stdlib.h>
+ #include <string.h>
#include <math.h>
#include <ctype.h>
***************
*** 22,27 ****
--- 23,29 ----
#endif
#include <tk.h>
+ #include "tkined.h"
/*
* The structure below defines the record for each barchart item.
***************
*** 589,598 ****
barPtr->bbox[0] = tmp;
}
! barPtr->header.x1 = barPtr->bbox[0] - 1;
! barPtr->header.y1 = barPtr->bbox[1] - 1;
! barPtr->header.x2 = barPtr->bbox[2] + 0.5;
! barPtr->header.y2 = barPtr->bbox[3] + 0.5;
}
/*
--- 591,600 ----
barPtr->bbox[0] = tmp;
}
! barPtr->header.x1 = (int)(barPtr->bbox[0] - 1.0);
! barPtr->header.y1 = (int)(barPtr->bbox[1] - 1.0);
! barPtr->header.x2 = (int)(barPtr->bbox[2] + 0.5);
! barPtr->header.y2 = (int)(barPtr->bbox[3] + 0.5);
}
/*
***************
*** 677,683 ****
autocolorGC = XCreateGC(display, drawable, 0, NULL);
for (i = 0; i < barPtr->numPoints; i++, xpos += width + bloat) {
! height = barPtr->coordPtr[i];
if (i >= barPtr->numPoints - rem) {
bloat = 1;
}
--- 679,685 ----
autocolorGC = XCreateGC(display, drawable, 0, NULL);
for (i = 0; i < barPtr->numPoints; i++, xpos += width + bloat) {
! height = (unsigned int)barPtr->coordPtr[i];
if (i >= barPtr->numPoints - rem) {
bloat = 1;
}
***************
*** 1244,1257 ****
*/
if (barPtr->numPoints > 0) {
! width = (barPtr->bbox[2]-barPtr->bbox[0]-1)/barPtr->numPoints;
rem = ((int) (barPtr->bbox[2]-barPtr->bbox[0]-1))%barPtr->numPoints;
}
xpos = barPtr->bbox[0];
bloat = 0;
for (i = 0; i < barPtr->numPoints; i++, xpos += width + bloat) {
! height = barPtr->coordPtr[i];
if (i >= barPtr->numPoints - rem) {
bloat = 1;
}
--- 1246,1259 ----
*/
if (barPtr->numPoints > 0) {
! width = (int)((barPtr->bbox[2]-barPtr->bbox[0]-1)/barPtr->numPoints);
rem = ((int) (barPtr->bbox[2]-barPtr->bbox[0]-1))%barPtr->numPoints;
}
xpos = barPtr->bbox[0];
bloat = 0;
for (i = 0; i < barPtr->numPoints; i++, xpos += width + bloat) {
! height = (unsigned int) barPtr->coordPtr[i];
if (i >= barPtr->numPoints - rem) {
bloat = 1;
}
diff -C 3 -r -w scotty-cvs/tkined/generic/tkiMethods.c scotty-my/tkined/generic/tkiMethods.c
*** scotty-cvs/tkined/generic/tkiMethods.c Sun Nov 29 13:52:20 1998
--- scotty-my/tkined/generic/tkiMethods.c Thu Nov 15 10:53:51 2001
***************
*** 21,26 ****
--- 21,31 ----
#include "tkined.h"
#include "tkiPort.h"
+ /* this is normally in tclIntPlatDecls.h, which doesn't appear
+ * to be installed on many systems */
+ EXTERN void TclGetAndDetachPids _ANSI_ARGS_((Tcl_Interp * interp,
+ Tcl_Channel chan));
+
#define USE_TCP_CHANNEL
/* #define NOTYET */
***************
*** 1092,1105 ****
{
static unsigned lastid = 0;
FILE *in;
int pargc = 0;
char **pargv = NULL;
char *file;
int largc;
char **largv = NULL;
char *bang = NULL;
! int i, code;
if (argc != 1) {
Tcl_SetResult (interp, "wrong # of args", TCL_STATIC);
--- 1097,1116 ----
{
static unsigned lastid = 0;
+ #ifndef __WIN32__
FILE *in;
+
+ #ifndef USE_TCP_CHANNEL
+ int code;
+ #endif
+ #endif
int pargc = 0;
char **pargv = NULL;
char *file;
int largc;
char **largv = NULL;
char *bang = NULL;
! int i;
if (argc != 1) {
Tcl_SetResult (interp, "wrong # of args", TCL_STATIC);
***************
*** 2384,2392 ****
if (argc == 1) {
Tki_Editor *editor = object->editor;
- #if 0
buffersize (strlen(argv[0])+8);
sprintf (buffer, "font-%s", argv[0]);
--- 2395,2403 ----
if (argc == 1) {
+ #if 0
Tki_Editor *editor = object->editor;
buffersize (strlen(argv[0])+8);
sprintf (buffer, "font-%s", argv[0]);
diff -C 3 -r -w scotty-cvs/tkined/generic/tkiStripchart.c scotty-my/tkined/generic/tkiStripchart.c
*** scotty-cvs/tkined/generic/tkiStripchart.c Mon Aug 14 10:03:24 2000
--- scotty-my/tkined/generic/tkiStripchart.c Thu Nov 15 11:07:44 2001
***************
*** 13,18 ****
--- 13,19 ----
#include <stdio.h>
#include <stdlib.h>
+ #include <string.h>
#include <math.h>
#include <ctype.h>
***************
*** 21,26 ****
--- 22,28 ----
#endif
#include <tk.h>
+ #include "tkined.h"
/* #define HAVE_LABEL */
***************
*** 648,657 ****
stripPtr->bbox[0] = tmp;
}
! stripPtr->header.x1 = stripPtr->bbox[0] - 1;
! stripPtr->header.y1 = stripPtr->bbox[1] - 1;
! stripPtr->header.x2 = stripPtr->bbox[2] + 1.5;
! stripPtr->header.y2 = stripPtr->bbox[3] + 1.5;
#ifdef HAVE_LABEL
if (stripPtr->fontPtr && stripPtr->text) {
--- 650,659 ----
stripPtr->bbox[0] = tmp;
}
! stripPtr->header.x1 = (int)(stripPtr->bbox[0] - 1.0);
! stripPtr->header.y1 = (int)(stripPtr->bbox[1] - 1.0);
! stripPtr->header.x2 = (int)(stripPtr->bbox[2] + 1.5);
! stripPtr->header.y2 = (int)(stripPtr->bbox[3] + 1.5);
#ifdef HAVE_LABEL
if (stripPtr->fontPtr && stripPtr->text) {
diff -C 3 -r -w scotty-cvs/tkined/generic/tkined.h scotty-my/tkined/generic/tkined.h
*** scotty-cvs/tkined/generic/tkined.h Wed Apr 21 09:13:41 1999
--- scotty-my/tkined/generic/tkined.h Tue Nov 13 15:12:20 2001
***************
*** 404,409 ****
--- 404,417 ----
extern char *type_to_string _ANSI_ARGS_((int type));
extern int string_to_type _ANSI_ARGS_((char *str));
+ void TkiMarkRectangle _ANSI_ARGS_((Display *display,
+ Drawable drawable,
+ GC gc,
+ int x1,
+ int y1,
+ int x2,
+ int y2 ));
+
/*
* Delete or append an item from/to a list stored as a tcl string list.
*/
diff -C 3 -r -w scotty-cvs/tnm/generic/tnmJob.c scotty-my/tnm/generic/tnmJob.c
*** scotty-cvs/tnm/generic/tnmJob.c Thu Jan 18 04:18:34 2001
--- scotty-my/tnm/generic/tnmJob.c Tue Nov 13 13:33:40 2001
***************
*** 330,338 ****
Tcl_GetAssocData(interp, tnmJobControl, NULL);
if (control) {
! Tcl_Preserve(interp);
Schedule(interp, control);
! Tcl_Release(interp);
}
}
--- 330,338 ----
Tcl_GetAssocData(interp, tnmJobControl, NULL);
if (control) {
! Tcl_Preserve(clientData);
Schedule(interp, control);
! Tcl_Release(clientData);
}
}
***************
*** 1060,1066 ****
listPtr = Tcl_GetObjResult(interp);
for (jobPtr = control->jobList; jobPtr; jobPtr = jobPtr->nextPtr) {
! if (status >= 0 && jobPtr->status != status) continue;
if (patList) {
int match = TnmMatchTags(interp, jobPtr->tagList, patList);
if (match < 0) {
--- 1060,1066 ----
listPtr = Tcl_GetObjResult(interp);
for (jobPtr = control->jobList; jobPtr; jobPtr = jobPtr->nextPtr) {
! if (status >= 0 && (int)jobPtr->status != status) continue;
if (patList) {
int match = TnmMatchTags(interp, jobPtr->tagList, patList);
if (match < 0) {
diff -C 3 -r -w scotty-cvs/tnm/generic/tnmMap.c scotty-my/tnm/generic/tnmMap.c
*** scotty-cvs/tnm/generic/tnmMap.c Wed Oct 6 04:35:58 1999
--- scotty-my/tnm/generic/tnmMap.c Tue Nov 13 13:37:58 2001
***************
*** 244,250 ****
score = 0;
}
! itemPtr->health = 0.6 * score + 0.4 * itemPtr->health;
if (itemPtr && itemPtr->expire) {
int expireTime = currentTime.sec - itemPtr->expire;
--- 244,250 ----
score = 0;
}
! itemPtr->health = (int)(0.6 * score + 0.4 * itemPtr->health);
if (itemPtr && itemPtr->expire) {
int expireTime = currentTime.sec - itemPtr->expire;
***************
*** 402,408 ****
itemPtr->nextPtr = mapPtr->itemList;
mapPtr->itemList = itemPtr;
mapPtr->numItems++;
! TnmMapCreateEvent(TNM_MAP_CREATE_EVENT, itemPtr, (ClientData) NULL);
return TCL_OK;
}
--- 402,408 ----
itemPtr->nextPtr = mapPtr->itemList;
mapPtr->itemList = itemPtr;
mapPtr->numItems++;
! TnmMapCreateEvent(TNM_MAP_CREATE_EVENT, itemPtr, (void *) NULL);
return TCL_OK;
}
***************
*** 432,438 ****
TnmMap *mapPtr = itemPtr->mapPtr;
int i;
! TnmMapCreateEvent(TNM_MAP_DELETE_EVENT, itemPtr, (ClientData) NULL);
/*
* First, update the list of all known items.
--- 432,438 ----
TnmMap *mapPtr = itemPtr->mapPtr;
int i;
! TnmMapCreateEvent(TNM_MAP_DELETE_EVENT, itemPtr, (void *) NULL);
/*
* First, update the list of all known items.
***************
*** 726,732 ****
}
listPtr = Tcl_GetObjResult(interp);
! for (i = 0; i < itemCnt; i++) {
char *cmdName = Tcl_GetCommandName(interp, itemVector[i]->token);
Tcl_Obj *elemObjPtr = Tcl_NewStringObj(cmdName, -1);
Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr);
--- 726,732 ----
}
listPtr = Tcl_GetObjResult(interp);
! for (i = 0; i < (int)itemCnt; i++) {
char *cmdName = Tcl_GetCommandName(interp, itemVector[i]->token);
Tcl_Obj *elemObjPtr = Tcl_NewStringObj(cmdName, -1);
Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr);
diff -C 3 -r -w scotty-cvs/tnm/generic/tnmMapEvent.c scotty-my/tnm/generic/tnmMapEvent.c
*** scotty-cvs/tnm/generic/tnmMapEvent.c Wed Oct 10 09:21:30 2001
--- scotty-my/tnm/generic/tnmMapEvent.c Tue Nov 13 13:40:20 2001
***************
*** 578,584 ****
}
interp = eventPtr->mapPtr->interp;
! Tcl_Preserve(interp);
Tcl_DStringInit(&tclCmd);
--- 578,584 ----
}
interp = eventPtr->mapPtr->interp;
! Tcl_Preserve((ClientData) interp);
Tcl_DStringInit(&tclCmd);
***************
*** 659,668 ****
switch (code) {
case TCL_BREAK:
! Tcl_Release(interp);
return TCL_BREAK;
case TCL_CONTINUE:
! Tcl_Release(interp);
return TCL_OK;
case TCL_ERROR:
{
--- 659,668 ----
switch (code) {
case TCL_BREAK:
! Tcl_Release((ClientData)interp);
return TCL_BREAK;
case TCL_CONTINUE:
! Tcl_Release((ClientData)interp);
return TCL_OK;
case TCL_ERROR:
{
***************
*** 681,693 ****
Tcl_AddErrorInfo(interp, ")");
Tcl_BackgroundError(interp);
Tcl_SetResult(interp, errorMsg, TCL_DYNAMIC);
! Tcl_Release(interp);
return TCL_ERROR;
}
}
}
! Tcl_Release(interp);
return TCL_OK;
}
--- 681,693 ----
Tcl_AddErrorInfo(interp, ")");
Tcl_BackgroundError(interp);
Tcl_SetResult(interp, errorMsg, TCL_DYNAMIC);
! Tcl_Release((ClientData)interp);
return TCL_ERROR;
}
}
}
! Tcl_Release((ClientData)interp);
return TCL_OK;
}
diff -C 3 -r -w scotty-cvs/tnm/generic/tnmMapUtil.c scotty-my/tnm/generic/tnmMapUtil.c
*** scotty-cvs/tnm/generic/tnmMapUtil.c Wed Oct 6 04:35:59 1999
--- scotty-my/tnm/generic/tnmMapUtil.c Tue Nov 13 13:38:46 2001
***************
*** 150,156 ****
result = TnmMapItemConfigure(itemPtr, interp, objc, objv);
if (result == TCL_OK && objc > 2) {
TnmMapCreateEvent(TNM_MAP_CONFIGURE_EVENT, itemPtr,
! (ClientData) NULL);
}
break;
--- 150,156 ----
result = TnmMapItemConfigure(itemPtr, interp, objc, objv);
if (result == TCL_OK && objc > 2) {
TnmMapCreateEvent(TNM_MAP_CONFIGURE_EVENT, itemPtr,
! (void *) NULL);
}
break;
***************
*** 185,191 ****
if (itemPtr->typePtr->moveProc) {
(itemPtr->typePtr->moveProc) (interp, itemPtr, x, y);
}
! TnmMapCreateEvent(TNM_MAP_MOVE_EVENT, itemPtr, (ClientData) NULL);
}
listPtr = Tcl_GetObjResult(interp);
Tcl_ListObjAppendElement(interp, listPtr, Tcl_NewIntObj(itemPtr->x));
--- 185,191 ----
if (itemPtr->typePtr->moveProc) {
(itemPtr->typePtr->moveProc) (interp, itemPtr, x, y);
}
! TnmMapCreateEvent(TNM_MAP_MOVE_EVENT, itemPtr, (void *) NULL);
}
listPtr = Tcl_GetObjResult(interp);
Tcl_ListObjAppendElement(interp, listPtr, Tcl_NewIntObj(itemPtr->x));
***************
*** 221,227 ****
TnmGetTime(&itemPtr->mtime);
}
TnmMapCreateEvent(TNM_MAP_ATTRIBUTE_EVENT, itemPtr,
! (ClientData) Tcl_GetStringFromObj(objv[2], NULL));
break;
}
break;
--- 221,227 ----
TnmGetTime(&itemPtr->mtime);
}
TnmMapCreateEvent(TNM_MAP_ATTRIBUTE_EVENT, itemPtr,
! (void *) Tcl_GetStringFromObj(objv[2], NULL));
break;
}
break;
diff -C 3 -r -w scotty-cvs/tnm/generic/tnmNetdb.c scotty-my/tnm/generic/tnmNetdb.c
*** scotty-cvs/tnm/generic/tnmNetdb.c Wed Oct 6 04:35:59 1999
--- scotty-my/tnm/generic/tnmNetdb.c Tue Nov 13 14:08:42 2001
***************
*** 33,38 ****
--- 33,47 ----
#endif
/*
+ * This is part of the Resolv lib, which we didn't
+ * get header files with.
+ */
+ #ifndef _NETDB_H
+ extern struct netent *getnetbyaddr(long net, int type);
+ extern struct netent *getnetbyname(const char *name);
+ #endif
+
+ /*
* Forward declarations for procedures defined later in this file:
*/
diff -C 3 -r -w scotty-cvs/tnm/generic/tnmNtp.c scotty-my/tnm/generic/tnmNtp.c
*** scotty-cvs/tnm/generic/tnmNtp.c Wed Feb 16 10:09:35 2000
--- scotty-my/tnm/generic/tnmNtp.c Tue Nov 13 14:12:52 2001
***************
*** 87,93 ****
static int
NtpFetch _ANSI_ARGS_((Tcl_Interp *interp, struct sockaddr_in *daddr,
int op, int retries, int timeo,
! char *buf, int assoc));
static int
NtpSplit _ANSI_ARGS_((Tcl_Interp *interp, char *varname,
char *pfix, char *buf));
--- 87,93 ----
static int
NtpFetch _ANSI_ARGS_((Tcl_Interp *interp, struct sockaddr_in *daddr,
int op, int retries, int timeo,
! char *buf, unsigned short assoc));
static int
NtpSplit _ANSI_ARGS_((Tcl_Interp *interp, char *varname,
char *pfix, char *buf));
***************
*** 199,205 ****
int rc;
FD_ZERO(&rfd);
! FD_SET(s, &rfd);
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
--- 199,205 ----
int rc;
FD_ZERO(&rfd);
! FD_SET((unsigned)s, &rfd);
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
***************
*** 254,260 ****
sprintf((char *) pkt->data,
"srcadr,stratum,precision,reach,valid,delay,offset,dispersion");
}
! pkt->len = htons(strlen((char *) pkt->data));
}
/*
--- 254,260 ----
sprintf((char *) pkt->data,
"srcadr,stratum,precision,reach,valid,delay,offset,dispersion");
}
! pkt->len = htons( (unsigned short)(strlen((char *)pkt->data)) );
}
/*
***************
*** 424,430 ****
{
int i;
! for (i = 0; i < strlen(data); i++) {
if (1 == sscanf(data + i, "peer=%d,", assoc)) {
return 1;
}
--- 424,430 ----
{
int i;
! for (i = 0; i < (int)strlen(data); i++) {
if (1 == sscanf(data + i, "peer=%d,", assoc)) {
return 1;
}
***************
*** 579,585 ****
*/
if (NtpGetPeer(data1, &assoc)) {
! if (NtpFetch(interp, &daddr, 2, actRetries, actTimeout, data2, assoc)
!= TCL_OK) {
Tcl_MutexUnlock(&ntpMutex);
return TCL_ERROR;
--- 579,586 ----
*/
if (NtpGetPeer(data1, &assoc)) {
! if (NtpFetch(interp, &daddr, 2, actRetries, actTimeout,
! data2, (unsigned short) assoc)
!= TCL_OK) {
Tcl_MutexUnlock(&ntpMutex);
return TCL_ERROR;
diff -C 3 -r -w scotty-cvs/tnm/generic/tnmSmx.c scotty-my/tnm/generic/tnmSmx.c
*** scotty-cvs/tnm/generic/tnmSmx.c Mon Feb 26 08:56:05 2001
--- scotty-my/tnm/generic/tnmSmx.c Tue Nov 13 14:16:08 2001
***************
*** 583,596 ****
* before execution really starts.
*/
! Tcl_Preserve(interp);
code = Tcl_VarEval(interp, profile, " ", slaveName, (char *) NULL);
if (code != TCL_OK) {
SmxAbortRun(interp, control, runPtr);
! Tcl_Release(interp);
return;
}
! Tcl_Release(interp);
/*
* Initialize the global variables arc, argv and argv0 which hold
--- 583,596 ----
* before execution really starts.
*/
! Tcl_Preserve((ClientData)interp);
code = Tcl_VarEval(interp, profile, " ", slaveName, (char *) NULL);
if (code != TCL_OK) {
SmxAbortRun(interp, control, runPtr);
! Tcl_Release((ClientData)interp);
return;
}
! Tcl_Release((ClientData)interp);
/*
* Initialize the global variables arc, argv and argv0 which hold
***************
*** 606,618 ****
{
Tcl_Interp *runInterp;
runInterp = runPtr->interp;
! Tcl_Preserve(runInterp);
code = Tcl_EvalFile(runInterp, script);
if (code == TCL_ERROR) {
SmxAbortRun(runInterp, control, runPtr);
/* runPtr is invalid now - so do not use it anymore */
}
! Tcl_Release(runInterp);
}
}
--- 606,618 ----
{
Tcl_Interp *runInterp;
runInterp = runPtr->interp;
! Tcl_Preserve((ClientData)runInterp);
code = Tcl_EvalFile(runInterp, script);
if (code == TCL_ERROR) {
SmxAbortRun(runInterp, control, runPtr);
/* runPtr is invalid now - so do not use it anymore */
}
! Tcl_Release((ClientData)runInterp);
}
}
diff -C 3 -r -w scotty-cvs/tnm/generic/tnmSunRpc.c scotty-my/tnm/generic/tnmSunRpc.c
*** scotty-cvs/tnm/generic/tnmSunRpc.c Wed Oct 6 04:36:00 1999
--- scotty-my/tnm/generic/tnmSunRpc.c Tue Nov 13 14:13:10 2001
***************
*** 917,923 ****
}
fp = res->facilities.facilities_val;
! for (i = 0; i < res->facilities.facilities_len; i++, fp++) {
char *index = NULL, *value;
if (i < sizeof(procs)/sizeof(char*)) {
index = procs[i];
--- 917,923 ----
}
fp = res->facilities.facilities_val;
! for (i = 0; i < (int)res->facilities.facilities_len; i++, fp++) {
char *index = NULL, *value;
if (i < sizeof(procs)/sizeof(char*)) {
index = procs[i];
diff -C 3 -r -w scotty-cvs/tnm/generic/tnmUdp.c scotty-my/tnm/generic/tnmUdp.c
*** scotty-cvs/tnm/generic/tnmUdp.c Fri Jan 19 05:15:51 2001
--- scotty-my/tnm/generic/tnmUdp.c Tue Nov 13 14:13:36 2001
***************
*** 102,108 ****
}
if (bindingPtr) {
! Tcl_Preserve(interp);
Tcl_AllowExceptions(interp);
code = Tcl_GlobalEval(interp, *bindingPtr);
if (code == TCL_ERROR) {
--- 102,108 ----
}
if (bindingPtr) {
! Tcl_Preserve((ClientData)interp);
Tcl_AllowExceptions(interp);
code = Tcl_GlobalEval(interp, *bindingPtr);
if (code == TCL_ERROR) {
***************
*** 111,117 ****
Tcl_BackgroundError(interp);
TnmDeleteSocketHandler(usock->sock);
}
! Tcl_Release(interp);
}
}
--- 111,117 ----
Tcl_BackgroundError(interp);
TnmDeleteSocketHandler(usock->sock);
}
! Tcl_Release((ClientData)interp);
}
}
diff -C 3 -r -w scotty-cvs/tnm/generic/tnmUtil.c scotty-my/tnm/generic/tnmUtil.c
*** scotty-cvs/tnm/generic/tnmUtil.c Fri Aug 11 09:22:20 2000
--- scotty-my/tnm/generic/tnmUtil.c Tue Nov 13 14:14:22 2001
***************
*** 120,126 ****
static char *buffer = NULL;
static size_t size = 0;
TnmTable *elemPtr;
! int cnt = 8;
char *p;
Tcl_MutexLock(&utilMutex);
--- 120,126 ----
static char *buffer = NULL;
static size_t size = 0;
TnmTable *elemPtr;
! size_t cnt = 8;
char *p;
Tcl_MutexLock(&utilMutex);
diff -C 3 -r -w scotty-cvs/tnm/snmp/tnmAsn1.c scotty-my/tnm/snmp/tnmAsn1.c
*** scotty-cvs/tnm/snmp/tnmAsn1.c Fri Jun 16 15:34:28 2000
--- scotty-my/tnm/snmp/tnmAsn1.c Thu Nov 15 11:08:52 2001
***************
*** 79,87 ****
--- 79,89 ----
* Forward declarations for procedures defined later in this file:
*/
+ #if 0 /* not used */
static u_char*
EncodeLength _ANSI_ARGS_((u_char *packet, int *packetlen,
int length));
+ #endif
/*
***************
*** 347,352 ****
--- 349,355 ----
return *packet;
}
+ #if 0 /* this function does not appear to be used at all */
static u_char*
EncodeLength(packet, packetlen, length)
u_char *packet;
***************
*** 372,377 ****
--- 375,382 ----
}
return packet;
}
+ #endif
+
/*
*----------------------------------------------------------------------
diff -C 3 -r -w scotty-cvs/tnm/snmp/tnmMibFrozen.c scotty-my/tnm/snmp/tnmMibFrozen.c
*** scotty-cvs/tnm/snmp/tnmMibFrozen.c Fri May 25 02:43:17 2001
--- scotty-my/tnm/snmp/tnmMibFrozen.c Tue Nov 13 14:22:48 2001
***************
*** 560,572 ****
FILE *fp;
{
TnmMibNode *root = NULL;
! int poolSize;
char *pool;
! int numEnums;
TnmMibRest *enums = NULL;
! int numTcs;
TnmMibType *tcs = NULL;
! int numNodes;
TnmMibNode *nodes;
/*
--- 560,572 ----
FILE *fp;
{
TnmMibNode *root = NULL;
! size_t poolSize;
char *pool;
! size_t numEnums;
TnmMibRest *enums = NULL;
! size_t numTcs;
TnmMibType *tcs = NULL;
! size_t numNodes;
TnmMibNode *nodes;
/*
***************
*** 616,622 ****
* Chain the pointers:
*/
! for (i = 0, restPtr = enums; i < numEnums; i++, restPtr++) {
restPtr->nextPtr = restPtr->nextPtr ? restPtr + 1 : 0;
}
}
--- 616,622 ----
* Chain the pointers:
*/
! for (i = 0, restPtr = enums; i < (int)numEnums; i++, restPtr++) {
restPtr->nextPtr = restPtr->nextPtr ? restPtr + 1 : 0;
}
}
***************
*** 647,653 ****
* Adjust string and enum pointers:
*/
! for (i = 0, typePtr = tcs; i < numTcs; i++, typePtr++) {
typePtr->name = (int) typePtr->name + pool;
if (typePtr->fileName) {
typePtr->fileName = (int) typePtr->fileName + pool;
--- 647,653 ----
* Adjust string and enum pointers:
*/
! for (i = 0, typePtr = tcs; i < (int) numTcs; i++, typePtr++) {
typePtr->name = (int) typePtr->name + pool;
if (typePtr->fileName) {
typePtr->fileName = (int) typePtr->fileName + pool;
***************
*** 703,709 ****
* Adjust string and tc pointers:
*/
! for (i = 0, ptr = nodes; i < numNodes; i++, ptr++) {
ptr->label = (int) ptr->label + pool;
ptr->parentName = (int) ptr->parentName + pool;
if (ptr->fileName) {
--- 703,709 ----
* Adjust string and tc pointers:
*/
! for (i = 0, ptr = nodes; i < (int) numNodes; i++, ptr++) {
ptr->label = (int) ptr->label + pool;
ptr->parentName = (int) ptr->parentName + pool;
if (ptr->fileName) {
diff -C 3 -r -w scotty-cvs/tnm/snmp/tnmMibParser.c scotty-my/tnm/snmp/tnmMibParser.c
*** scotty-cvs/tnm/snmp/tnmMibParser.c Fri Apr 6 11:09:02 2001
--- scotty-my/tnm/snmp/tnmMibParser.c Thu Nov 15 10:23:24 2001
***************
*** 30,35 ****
--- 30,39 ----
* Token used by the MIB parser.
*/
+ #ifdef ERROR
+ #undef ERROR
+ #endif
+
#define ERROR -2
#define DEFINITIONS 51
***************
*** 63,68 ****
--- 67,77 ----
#define STATUS 100
#define MANDATORY 101
+
+ #ifdef OPTIONAL
+ #undef OPTIONAL
+ #endif
+
#define OPTIONAL 102
#define OBSOLETE 103
#define CURRENT 104
***************
*** 1273,1279 ****
FILE *fp;
char *keyword;
{
! int level = 0, syntax = 0, merk, osyntax, offset = 0, status = 0;
char name [SYMBOL_MAXLEN];
char otype [SYMBOL_MAXLEN];
char convention [SYMBOL_MAXLEN];
--- 1282,1291 ----
FILE *fp;
char *keyword;
{
! #ifndef USE_RANGES
! int level = 0;
! #endif
! int syntax = 0, merk, osyntax, offset = 0, status = 0;
char name [SYMBOL_MAXLEN];
char otype [SYMBOL_MAXLEN];
char convention [SYMBOL_MAXLEN];
diff -C 3 -r -w scotty-cvs/tnm/snmp/tnmMibTree.c scotty-my/tnm/snmp/tnmMibTree.c
*** scotty-cvs/tnm/snmp/tnmMibTree.c Wed Oct 28 09:36:59 1998
--- scotty-my/tnm/snmp/tnmMibTree.c Tue Nov 13 14:25:48 2001
***************
*** 360,366 ****
if (((strcmp (head, brother->label) == 0)
&& (*moduleName == '\0'
|| strcmp(moduleName, brother->moduleName) == 0))
! || (num == brother->subid)) {
if (! *tail) {
tp = brother;
} else if (brother->childPtr) {
--- 360,366 ----
if (((strcmp (head, brother->label) == 0)
&& (*moduleName == '\0'
|| strcmp(moduleName, brother->moduleName) == 0))
! || ((u_int) num == brother->subid)) {
if (! *tail) {
tp = brother;
} else if (brother->childPtr) {
diff -C 3 -r -w scotty-cvs/tnm/snmp/tnmMibUtil.c scotty-my/tnm/snmp/tnmMibUtil.c
*** scotty-cvs/tnm/snmp/tnmMibUtil.c Mon Jun 25 02:47:25 2001
--- scotty-my/tnm/snmp/tnmMibUtil.c Tue Nov 13 14:24:30 2001
***************
*** 776,782 ****
if (valid) {
while (pfx > 0) {
! char c = (vv >> ((pfx - 1) * 8));
Tcl_AppendToObj(objPtr, &c, 1);
pfx--;
}
--- 776,782 ----
if (valid) {
while (pfx > 0) {
! char c = (char) (vv >> ((pfx - 1) * 8));
Tcl_AppendToObj(objPtr, &c, 1);
pfx--;
}
diff -C 3 -r -w scotty-cvs/tnm/snmp/tnmSnmpNet.c scotty-my/tnm/snmp/tnmSnmpNet.c
*** scotty-cvs/tnm/snmp/tnmSnmpNet.c Mon Dec 6 08:44:01 1999
--- scotty-my/tnm/snmp/tnmSnmpNet.c Tue Nov 13 14:36:54 2001
***************
*** 276,282 ****
wait.tv_usec = (ms % 1000) * 1000;
width = snmpSocket->sock + 1;
FD_ZERO(&readfds);
! FD_SET(snmpSocket->sock, &readfds);
return select(width, &readfds, (fd_set *) NULL, (fd_set *) NULL, &wait);
}
--- 276,282 ----
wait.tv_usec = (ms % 1000) * 1000;
width = snmpSocket->sock + 1;
FD_ZERO(&readfds);
! FD_SET((unsigned) snmpSocket->sock, &readfds);
return select(width, &readfds, (fd_set *) NULL, (fd_set *) NULL, &wait);
}
diff -C 3 -r -w scotty-cvs/tnm/snmp/tnmSnmpRecv.c scotty-my/tnm/snmp/tnmSnmpRecv.c
*** scotty-cvs/tnm/snmp/tnmSnmpRecv.c Fri Jan 7 05:32:37 2000
--- scotty-my/tnm/snmp/tnmSnmpRecv.c Tue Nov 13 14:18:14 2001
***************
*** 1187,1193 ****
*/
pdu->type = TnmBerTag(packet, packetlen);
! packet = TnmBerDecSequenceStart(packet, packetlen, pdu->type,
&pduSeqToken, &pduSeqLength);
if (packet == NULL) {
tnmSnmpStats.snmpInASNParseErrs++;
--- 1187,1193 ----
*/
pdu->type = TnmBerTag(packet, packetlen);
! packet = TnmBerDecSequenceStart(packet, packetlen, (u_char) pdu->type,
&pduSeqToken, &pduSeqLength);
if (packet == NULL) {
tnmSnmpStats.snmpInASNParseErrs++;
diff -C 3 -r -w scotty-cvs/tnm/snmp/tnmSnmpSend.c scotty-my/tnm/snmp/tnmSnmpSend.c
*** scotty-cvs/tnm/snmp/tnmSnmpSend.c Thu Aug 12 05:29:33 1999
--- scotty-my/tnm/snmp/tnmSnmpSend.c Tue Nov 13 14:19:04 2001
***************
*** 867,873 ****
int oidlen;
packet = TnmBerEncSequenceStart(packet, packetlen,
! pdu->type, &pduSeqToken);
if (pdu->type == ASN1_SNMP_TRAP1) {
--- 867,873 ----
int oidlen;
packet = TnmBerEncSequenceStart(packet, packetlen,
! (u_char) pdu->type, &pduSeqToken);
if (pdu->type == ASN1_SNMP_TRAP1) {
***************
*** 1117,1123 ****
if (rc != TCL_OK) return NULL;
}
packet = TnmBerEncInt(packet, packetlen,
! asn1_type, int_val);
break;
}
case ASN1_COUNTER64: {
--- 1117,1123 ----
if (rc != TCL_OK) return NULL;
}
packet = TnmBerEncInt(packet, packetlen,
! (u_char) asn1_type, int_val);
break;
}
case ASN1_COUNTER64: {
***************
*** 1233,1239 ****
case ASN1_NO_SUCH_INSTANCE:
case ASN1_END_OF_MIB_VIEW:
case ASN1_NULL:
! packet = TnmBerEncNull(packet, packetlen, asn1_type);
break;
default:
sprintf(interp->result, "unknown asn1 type 0x%.2x",
--- 1233,1239 ----
case ASN1_NO_SUCH_INSTANCE:
case ASN1_END_OF_MIB_VIEW:
case ASN1_NULL:
! packet = TnmBerEncNull(packet, packetlen, (u_char) asn1_type);
break;
default:
sprintf(interp->result, "unknown asn1 type 0x%.2x",
diff -C 3 -r -w scotty-cvs/tnm/snmp/tnmSnmpUtil.c scotty-my/tnm/snmp/tnmSnmpUtil.c
*** scotty-cvs/tnm/snmp/tnmSnmpUtil.c Fri Jan 7 05:32:37 2000
--- scotty-my/tnm/snmp/tnmSnmpUtil.c Tue Nov 13 14:19:52 2001
***************
*** 1095,1101 ****
TnmSnmpRequest *rPtr;
for (rPtr = queueHead; rPtr; rPtr = rPtr->nextPtr) {
! if (rPtr->id == id) break;
}
return rPtr;
}
--- 1095,1101 ----
TnmSnmpRequest *rPtr;
for (rPtr = queueHead; rPtr; rPtr = rPtr->nextPtr) {
! if (rPtr->id == (u_int) id) break;
}
return rPtr;
}
***************
*** 1295,1301 ****
do {
id = rand();
! for (rPtr = queueHead; rPtr && rPtr->id != id; rPtr = rPtr->nextPtr) {
/* empty body */
}
} while (rPtr);
--- 1295,1301 ----
do {
id = rand();
! for (rPtr = queueHead; rPtr && rPtr->id != (u_int) id; rPtr = rPtr->nextPtr) {
/* empty body */
}
} while (rPtr);
diff -C 3 -r -w scotty-cvs/unix/nmicmpd.c scotty-my/unix/nmicmpd.c
*** scotty-cvs/unix/nmicmpd.c Thu Feb 8 06:49:20 2001
--- scotty-my/unix/nmicmpd.c Thu Nov 15 10:25:57 2001
***************
*** 537,543 ****
got_it = 1;
dsyslog(LOG_DEBUG,
"icmp-reply from 0x%08lx with byte-swapped port",
! ntohl(ip->ip_src.s_addr));
}
}
--- 537,543 ----
got_it = 1;
dsyslog(LOG_DEBUG,
"icmp-reply from 0x%08lx with byte-swapped port",
! (unsigned long) ntohl(ip->ip_src.s_addr));
}
}
***************
*** 786,792 ****
job->done = 1;
job->addr = sfrom.sin_addr;
dsyslog(LOG_DEBUG, "job %d: mask 0x%lx\n", job->tid,
! ntohl((long) job->u.data));
break;
case ICMP_TYPE_TSTAMP:
--- 786,792 ----
job->done = 1;
job->addr = sfrom.sin_addr;
dsyslog(LOG_DEBUG, "job %d: mask 0x%lx\n", job->tid,
! (unsigned long) ntohl((long) job->u.data));
break;
case ICMP_TYPE_TSTAMP:
***************
*** 1572,1578 ****
}
dsyslog(LOG_DEBUG,
! "job %d: done %d, probe_cnt %d, retries %d, tdiff %d, ival %d",
job->tid, job->done, job->probe_cnt, job->u.c.retries,
time_diff(job->time_sent,now), job->retry_ival);
--- 1572,1578 ----
}
dsyslog(LOG_DEBUG,
! "job %d: done %d, probe_cnt %d, retries %d, tdiff %ld, ival %d",
job->tid, job->done, job->probe_cnt, job->u.c.retries,
time_diff(job->time_sent,now), job->retry_ival);
***************
*** 1584,1590 ****
&& time_diff(job->time_sent,now) > job->retry_ival) {
dsyslog(LOG_DEBUG,
! "job %d: sending probe # %d (%d > %d) with win %d >= %d",
job->tid, job->probe_cnt, time_diff(job->time_sent,now),
job->retry_ival, job->window, window);
--- 1584,1590 ----
&& time_diff(job->time_sent,now) > job->retry_ival) {
dsyslog(LOG_DEBUG,
! "job %d: sending probe # %d (%ld > %d) with win %d >= %d",
job->tid, job->probe_cnt, time_diff(job->time_sent,now),
job->retry_ival, job->window, window);
diff -C 3 -r -w scotty-cvs/unix/nmtrapd.c scotty-my/unix/nmtrapd.c
*** scotty-cvs/unix/nmtrapd.c Fri Dec 1 08:35:20 2000
--- scotty-my/unix/nmtrapd.c Thu Nov 15 10:26:33 2001
***************
*** 213,222 ****
struct sockaddr_in taddr, laddr;
#if 0
struct sockaddr_un saddr, daddr;
#else
struct sockaddr_in saddr, daddr;
#endif
! int trap_s, serv_s, slen, dlen, llen, rc, i;
fd_set fds;
static int cl_addr[FD_SETSIZE];
char buf[2048], path[1024];
--- 213,223 ----
struct sockaddr_in taddr, laddr;
#if 0
struct sockaddr_un saddr, daddr;
+ int slen;
#else
struct sockaddr_in saddr, daddr;
#endif
! int trap_s, serv_s, dlen, llen, rc, i;
fd_set fds;
static int cl_addr[FD_SETSIZE];
char buf[2048], path[1024];
diff -C 3 -r -w scotty-cvs/win/makefile scotty-my/win/makefile
*** scotty-cvs/win/makefile Sat Jun 23 11:54:07 2001
--- scotty-my/win/makefile Thu Nov 15 11:16:03 2001
***************
*** 30,41 ****
ROOT = .\..
TMPDIR = .
! #TOOLS32= c:\msdev
! TOOLS32 = c:\vc98
! #SYSTEM32= c:\winnt\system32
! SYSTEM32= c:\windows
! TCL = c:\tcl
! TCLP = c:/tcl
TNM = $(TCL)\lib\tnm$(TNM_VERSION)
TNMP = $(TCLP)/lib/tnm$(TNM_VERSION)
TKI = $(TCL)\lib\tkined$(TKI_VERSION)
--- 30,40 ----
ROOT = .\..
TMPDIR = .
! SYSTEM32= c:\winnt\system32
!
! # set this to point to your Tcl Install directory
! TCL = C:\TclPro1.4
! TCLP = C:/TclPro1.4
TNM = $(TCL)\lib\tnm$(TNM_VERSION)
TNMP = $(TCLP)/lib/tnm$(TNM_VERSION)
TKI = $(TCL)\lib\tkined$(TKI_VERSION)
***************
*** 48,60 ****
# Visual C++ tools
#
! PATH=$(TOOLS32)\bin;$(PATH)
!
! cc32 = $(TOOLS32)\bin\cl -I$(TOOLS32)\include
CP = copy
RM = del
! INCLUDES = -I $(ROOT)\tnm\generic -I$(ROOT)\tnm\snmp -I$(ROOT)\compat -I$(ROOT)\compat\res -I$(ROOT)\tkined\generic -I$(TOOLS32)\include -I$(TCL)\include -I$(ROOT)\win
DEFINES = -nologo $(DEBUGDEFINES) -Di386 -DBUILD_tnm -DTKINEDLIB=\"$(TKIP)\" -DTNMLIB=\"$(TNMP)\"
!include <ntwin32.mak>
--- 47,57 ----
# Visual C++ tools
#
! cc32 = cl
CP = copy
RM = del
! INCLUDES = -I $(ROOT)\tnm\generic -I$(ROOT)\tnm\snmp -I$(ROOT)\compat -I$(ROOT)\compat\res -I$(ROOT)\tkined\generic -I$(TCL)\include -I$(ROOT)\win
DEFINES = -nologo $(DEBUGDEFINES) -Di386 -DBUILD_tnm -DTKINEDLIB=\"$(TKIP)\" -DTNMLIB=\"$(TNMP)\"
!include <ntwin32.mak>
***************
*** 63,69 ****
# BoundsChecker tools -- uncomment only to run BoundsChecker!
#
- BCPRONT = c:\BCProNT
#PATH=$(BCPRONT);$(PATH)
#cc32 = $(BCPRONT)\BCOMPILE
#link = $(BCPRONT)\BCLINK
--- 60,65 ----
***************
*** 143,156 ****
tnm.dll: $(TNMOBJS) oncrpc.lib resolv.lib
$(link) $(linkdebug) $(dlllflags) \
! $(TCLP)/lib/tcl$(TCL_DLL_VERSION).lib \
oncrpc.lib resolv.lib wsock32.lib \
$(guilibsdll) -out:tnm.dll $(TNMOBJS)
tkined.dll: $(TKIOBJS)
$(link) $(linkdebug) $(dlllflags) \
! $(TCLP)/lib/tcl$(TCL_DLL_VERSION).lib \
! $(TCLP)/lib/tk$(TK_DLL_VERSION).lib $(guilibsdll) \
-out:tkined.dll $(TKIOBJS)
# Implicit Targets
--- 139,152 ----
tnm.dll: $(TNMOBJS) oncrpc.lib resolv.lib
$(link) $(linkdebug) $(dlllflags) \
! $(TCLP)/win32-ix86/lib/tcl$(TCL_DLL_VERSION).lib \
oncrpc.lib resolv.lib wsock32.lib \
$(guilibsdll) -out:tnm.dll $(TNMOBJS)
tkined.dll: $(TKIOBJS)
$(link) $(linkdebug) $(dlllflags) \
! $(TCLP)/win32-ix86/lib/tcl$(TCL_DLL_VERSION).lib \
! $(TCLP)/win32-ix86/lib/tk$(TK_DLL_VERSION).lib $(guilibsdll) \
-out:tkined.dll $(TKIOBJS)
# Implicit Targets
***************
*** 195,201 ****
copy $(ROOT)\tnm\mibs\*-TM $(TNM)\mibs
copy $(ROOT)\tnm\mibs\*-MIB $(TNM)\mibs
copy $(ROOT)\tnm\mibs\*-CONF $(TNM)\mibs
! copy $(ROOT)\tnm\mibs\*-TYPES $(TNM)\mibs
tnm-install-agents:
-mkdir $(TNM)\agents
--- 191,197 ----
copy $(ROOT)\tnm\mibs\*-TM $(TNM)\mibs
copy $(ROOT)\tnm\mibs\*-MIB $(TNM)\mibs
copy $(ROOT)\tnm\mibs\*-CONF $(TNM)\mibs
! copy $(ROOT)\tnm\mibs\*-COMPAT $(TNM)\mibs
tnm-install-agents:
-mkdir $(TNM)\agents
***************
*** 232,242 ****
cd $(ROOT)\tnm\tests
$(TCL)\bin\tclsh$(TCL_SH_VERSION) all
clean:
-$(RM) $(TMPDIR)\*.obj
-$(RM) $(TMPDIR)\tnm.dll
-$(RM) $(TMPDIR)\tkined.dll
! -$(RM) $(TMPDIR)\*.lib
-$(RM) $(TMPDIR)\*.exp
-$(RM) $(TMPDIR)\bcc32.cfg
--- 228,240 ----
cd $(ROOT)\tnm\tests
$(TCL)\bin\tclsh$(TCL_SH_VERSION) all
+ # Note: we delete explicit .lib files rather than
+ # *.lib so we don't delete onrpc.lib and resolv.lib
clean:
-$(RM) $(TMPDIR)\*.obj
-$(RM) $(TMPDIR)\tnm.dll
-$(RM) $(TMPDIR)\tkined.dll
! -$(RM) $(TMPDIR)\tkined.lib $(TMPDIR)\tnm.lib
-$(RM) $(TMPDIR)\*.exp
-$(RM) $(TMPDIR)\bcc32.cfg
diff -C 3 -r -w scotty-cvs/win/tnmWinIcmp.c scotty-my/win/tnmWinIcmp.c
*** scotty-cvs/win/tnmWinIcmp.c Wed Sep 17 15:40:21 1997
--- scotty-my/win/tnmWinIcmp.c Tue Nov 13 14:27:58 2001
***************
*** 287,293 ****
for (i = j, nCount = 0;
i < icmpPtr->numTargets && nCount < 200
! && (! icmpPtr->window || nCount < icmpPtr->window);
i++, nCount++) {
DWORD dwThreadId;
--- 287,293 ----
for (i = j, nCount = 0;
i < icmpPtr->numTargets && nCount < 200
! && (! icmpPtr->window || (int)nCount < icmpPtr->window);
i++, nCount++) {
DWORD dwThreadId;
diff -C 3 -r -w scotty-cvs/win/tnmWinSocket.c scotty-my/win/tnmWinSocket.c
*** scotty-cvs/win/tnmWinSocket.c Thu Oct 29 08:18:43 1998
--- scotty-my/win/tnmWinSocket.c Tue Nov 13 14:34:30 2001
***************
*** 17,22 ****
--- 17,27 ----
#include "tnmPort.h"
/*
+ * TclPro does not seem to have tclIntPlatDecls.h
+ */
+ EXTERN void TclWinConvertWSAError _ANSI_ARGS_((DWORD errCode));
+
+ /*
* The following structure is used to keep track of Tcl channels
* opened on sockets for the purpose of getting events from the Tcl
* channel driver.
-- !! This message is brought to you via the `tkined & scotty' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>. !! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.
This archive was generated by hypermail 2b29 : Thu Jan 03 2002 - 14:56:28 MET