--- mstools/samples/rpc/dict/util0.c 2018/08/09 18:20:01 1.1 +++ mstools/samples/rpc/dict/util0.c 2018/08/09 18:20:57 1.1.1.2 @@ -2,7 +2,7 @@ /** **/ /** Microsoft RPC Examples **/ /** Dictionary Application **/ -/** Copyright(c) Microsoft Corp. 1991 **/ +/** Copyright(c) Microsoft Corp. 1992 **/ /** **/ /*************************************************************/ @@ -11,9 +11,17 @@ #include #include #include + +#ifdef NTENV #include +// #define printf DbgPrint +#endif // NTENV #include +// #include +// #include +// #include + #include "dict0.h" #ifndef _LOCAL @@ -160,9 +168,8 @@ Tree_Duplicate( /*** MIDL_user_allocate / MIDL_user_free ***/ /*************************************************************************/ -/* void * -MIDL_user_allocate(unsigned long count) +MIDL_user_allocate(size_t count) { unsigned char * ptr; @@ -170,10 +177,17 @@ MIDL_user_allocate(unsigned long count) return ( ptr ); } -*/ + +void +MIDL_user_free(void * p) +{ + free (p); +} + +/* void * -MIDL_user_allocate(unsigned long count) +MIDL_user_allocate(size_t count) { unsigned char *ptr, *old; @@ -223,6 +237,8 @@ MIDL_user_free(void * p) free (ptr); } +*/ + /*************************************************************************/ /*** Utility functions ***/ /*************************************************************************/ @@ -267,6 +283,10 @@ makeRecord( ) { Record * pr = (Record*) MIDL_user_allocate(sizeof(Record)); + + if (!name) + printf("makeRecord: NULL name\n"); + pr->name = (char*) MIDL_user_allocate(strlen(name)+1); strcpy(pr->name, name); pr->key = key; @@ -323,14 +343,13 @@ char spaces[] = - - void prinTree(int lmargin, /* indentation of the root of the tree */ int indent, /* indentation of subsequent levels */ TreeNode *np, /* pointer to the root node */ PrintFun print) /* short, one line, record print routine */ { + int i; if (np == NULL) return; prinTree(lmargin+indent, indent, np->right, print);