diff --git a/graphics/traveler/tools/libwld/wld_fatalerror.c b/graphics/traveler/tools/libwld/wld_fatalerror.c index fa0807574..05d812643 100644 --- a/graphics/traveler/tools/libwld/wld_fatalerror.c +++ b/graphics/traveler/tools/libwld/wld_fatalerror.c @@ -48,16 +48,16 @@ *************************************************************************/ /************************************************************************* - * Name: wld_FatalError + * Name: wld_fatal_error ************************************************************************/ /************************************************************************* - * Name: wld_FatalError - * Description: A dummy version of wld_FatalError that will be used if + * Name: wld_fatal_error + * Description: A dummy version of wld_fatal_error that will be used if * the application does not provide a better one. ************************************************************************/ -void wld_FatalError(char *message, ...) +void wld_fatal_error(char *message, ...) { va_list args; diff --git a/graphics/traveler/tools/libwld/wld_findplane.c b/graphics/traveler/tools/libwld/wld_findplane.c index 186344bd3..815829029 100644 --- a/graphics/traveler/tools/libwld/wld_findplane.c +++ b/graphics/traveler/tools/libwld/wld_findplane.c @@ -48,13 +48,13 @@ *************************************************************************/ /************************************************************************* - * Name: wld_FindPlane + * Name: wld_find_plane * Description: * This function finds the plane at the specified point in the world plane * list ************************************************************************/ -rectListType *wld_FindPlane(coord_t h, coord_t v, coord_t plane, +rectListType *wld_find_plane(coord_t h, coord_t v, coord_t plane, rectHeadType *list) { rectListType *rect; diff --git a/graphics/traveler/tools/libwld/wld_free.c b/graphics/traveler/tools/libwld/wld_free.c index b403be2ee..30d60bb01 100644 --- a/graphics/traveler/tools/libwld/wld_free.c +++ b/graphics/traveler/tools/libwld/wld_free.c @@ -56,7 +56,7 @@ void wld_Free(void *addr) { if (addr == NULL) { - wld_FatalError("freeing NULL"); + wld_fatal_error("freeing NULL"); } else { diff --git a/graphics/traveler/tools/libwld/wld_loadgif.c b/graphics/traveler/tools/libwld/wld_loadgif.c index 57ebeba2b..165fb8ae7 100644 --- a/graphics/traveler/tools/libwld/wld_loadgif.c +++ b/graphics/traveler/tools/libwld/wld_loadgif.c @@ -236,20 +236,20 @@ GraphicFileType *wld_LoadGIF(FILE *fp, char *fname) fseek(fp, 0L, 0); if (!(ptr = RawGIF = (uint8_t *) malloc(filesize))) - wld_FatalError("not enough memory to read gif file"); + wld_fatal_error("not enough memory to read gif file"); if (!(Rwld_er = (uint8_t *) malloc(filesize))) { free(ptr); - wld_FatalError("not enough memory to read gif file"); + wld_fatal_error("not enough memory to read gif file"); } if (fread(ptr, filesize, 1, fp) != 1) - wld_FatalError("GIF data read failed"); + wld_fatal_error("GIF data read failed"); if (strncmp(ptr, id87, 6)) if (strncmp(ptr, id89, 6)) - wld_FatalError("not a GIF file"); + wld_fatal_error("not a GIF file"); ptr += 6; @@ -273,7 +273,7 @@ GraphicFileType *wld_LoadGIF(FILE *fp, char *fname) Background = NEXTBYTE; /* background color... not used. */ if (NEXTBYTE) /* supposed to be NULL */ - wld_FatalError("corrupt GIF file (bad screen descriptor)"); + wld_fatal_error("corrupt GIF file (bad screen descriptor)"); /* Read in global colormap. */ @@ -301,7 +301,7 @@ GraphicFileType *wld_LoadGIF(FILE *fp, char *fname) i = ch; fprintf(stderr, "EXTENSION CHARACTER: %x\n", i); if (ch != START_EXTENSION) - wld_FatalError("corrupt GIF89a file"); + wld_fatal_error("corrupt GIF89a file"); /* Handle image extensions */ @@ -323,7 +323,7 @@ GraphicFileType *wld_LoadGIF(FILE *fp, char *fname) case COMMENT_EXT: break; default: - wld_FatalError("invalid GIF89 extension"); + wld_fatal_error("invalid GIF89 extension"); } while ((ch = NEXTBYTE)) @@ -397,7 +397,7 @@ GraphicFileType *wld_LoadGIF(FILE *fp, char *fname) ch = ch1 = NEXTBYTE; while (ch--) *ptr1++ = NEXTBYTE; if ((ptr1 - Rwld_er) > filesize) - wld_FatalError("corrupt GIF file (unblock)"); + wld_fatal_error("corrupt GIF file (unblock)"); } while(ch1); diff --git a/graphics/traveler/tools/libwld/wld_loadppm.c b/graphics/traveler/tools/libwld/wld_loadppm.c index 4e965b43a..adee439ce 100644 --- a/graphics/traveler/tools/libwld/wld_loadppm.c +++ b/graphics/traveler/tools/libwld/wld_loadppm.c @@ -106,25 +106,25 @@ GraphicFileType *wld_LoadPPM(FILE *fp, char *filename) skip_cruft(fp); if (getc(fp) != 'P' || getc(fp) != '6') { - wld_FatalError("%s is not a ppm file.", filename); + wld_fatal_error("%s is not a ppm file.", filename); } skip_cruft(fp); if (fscanf(fp, "%d", &width) != 1) { - wld_FatalError("%s: bad ppm file.", filename); + wld_fatal_error("%s: bad ppm file.", filename); } skip_cruft(fp); if (fscanf(fp, "%d", &height) != 1) { - wld_FatalError("%s: bad ppm file.", filename); + wld_fatal_error("%s: bad ppm file.", filename); } skip_cruft(fp); if (fscanf(fp, "%d\n", &unknown) != 1) { - wld_FatalError("%s: bad ppm file.", filename); + wld_fatal_error("%s: bad ppm file.", filename); } gfile = wld_NewGraphicFile(); @@ -136,7 +136,7 @@ GraphicFileType *wld_LoadPPM(FILE *fp, char *filename) if (fread(gfile->bitmap, height * width * 3, 1, fp) != 1) { - wld_FatalError("%s: incomplete data", filename); + wld_fatal_error("%s: incomplete data", filename); } return gfile; diff --git a/graphics/traveler/tools/libwld/wld_malloc.c b/graphics/traveler/tools/libwld/wld_malloc.c index 4ba90a2fc..64f8ae481 100644 --- a/graphics/traveler/tools/libwld/wld_malloc.c +++ b/graphics/traveler/tools/libwld/wld_malloc.c @@ -59,7 +59,7 @@ void *wld_Malloc(size_t size) new = malloc(size); if (new == NULL) { - wld_FatalError("out of memory (wld_Malloc %x bytes)", size); + wld_fatal_error("out of memory (wld_Malloc %x bytes)", size); } return new; } diff --git a/graphics/traveler/tools/libwld/wld_moveplane.c b/graphics/traveler/tools/libwld/wld_moveplane.c index a734bb594..58c2a9c6c 100644 --- a/graphics/traveler/tools/libwld/wld_moveplane.c +++ b/graphics/traveler/tools/libwld/wld_moveplane.c @@ -48,13 +48,13 @@ *************************************************************************/ /************************************************************************* - * Name: wld_MovePlane + * Name: wld_move_plane * Description: * This function removes the specified plane from the world plane srcList * then adds it to the world plane destList ************************************************************************/ -void wld_MovePlane(rectListType *rect, rectHeadType *destList, +void wld_move_plane(rectListType *rect, rectHeadType *destList, rectHeadType *srcList) { /* Un-hook the backward link to the rect */ diff --git a/graphics/traveler/tools/libwld/wld_plane.h b/graphics/traveler/tools/libwld/wld_plane.h index e011f1817..51f1960b8 100644 --- a/graphics/traveler/tools/libwld/wld_plane.h +++ b/graphics/traveler/tools/libwld/wld_plane.h @@ -176,12 +176,12 @@ extern void wld_AddPlane(rectListType *rect, rectHeadType *list); extern void wld_MergePlaneLists(rectHeadType *outList, rectHeadType *inList); -extern void wld_RemovePlane(rectListType *rect, +extern void wld_remove_plane(rectListType *rect, rectHeadType *list); -extern void wld_MovePlane(rectListType *rect, +extern void wld_move_plane(rectListType *rect, rectHeadType *destList, rectHeadType *srcList); -extern rectListType *wld_FindPlane(coord_t h, coord_t v, coord_t plane, +extern rectListType *wld_find_plane(coord_t h, coord_t v, coord_t plane, rectHeadType *list); #ifdef __cplusplus diff --git a/graphics/traveler/tools/libwld/wld_readgraphicfile.c b/graphics/traveler/tools/libwld/wld_readgraphicfile.c index 9fa46a73c..98c75d5fc 100644 --- a/graphics/traveler/tools/libwld/wld_readgraphicfile.c +++ b/graphics/traveler/tools/libwld/wld_readgraphicfile.c @@ -71,7 +71,7 @@ static GraphicFileFormatType wld_CheckFormat(FILE *fp, char *filename) if (fread(magic, 1, MAGIC_LENGTH, fp) != MAGIC_LENGTH) { - wld_FatalError("Error reading texture %s.", filename); + wld_fatal_error("Error reading texture %s.", filename); } if (strncmp(magic, PPM_MAGIC, sizeof(PPM_MAGIC) - 1) == 0) @@ -138,7 +138,7 @@ GraphicFileType *wld_ReadGraphicFile(char *filename) if ((fp = fopen(filename, "rb")) == NULL) { - wld_FatalError("Could not open texture %s", filename); + wld_fatal_error("Could not open texture %s", filename); } format = wld_CheckFormat(fp, filename); @@ -160,17 +160,17 @@ GraphicFileType *wld_ReadGraphicFile(char *filename) break; case formatUnknown: - wld_FatalError("Unknown graphic file format.\n"); + wld_fatal_error("Unknown graphic file format.\n"); break; default: - wld_FatalError("The graphic file reading code is really broken.\n"); + wld_fatal_error("The graphic file reading code is really broken.\n"); break; } if (gfile == NULL) { - wld_FatalError("Error reading texture %s\n"); + wld_fatal_error("Error reading texture %s\n"); } fclose(fp); diff --git a/graphics/traveler/tools/libwld/wld_readtexturefile.c b/graphics/traveler/tools/libwld/wld_readtexturefile.c index 4baccf46d..7bf1fedaa 100644 --- a/graphics/traveler/tools/libwld/wld_readtexturefile.c +++ b/graphics/traveler/tools/libwld/wld_readtexturefile.c @@ -73,7 +73,7 @@ static bitmapType *wld_NewTexture(uint16_t width, uint16_t height) bitmapType *t; if (height <= 0 || width <= 0) - wld_FatalError("wld_NewTexture: bad texture dimensions"); + wld_fatal_error("wld_NewTexture: bad texture dimensions"); t = (bitmapType*)wld_Malloc(sizeof(bitmapType)); t->bm = (trv_pixel_t*)wld_Malloc(height * width * sizeof(trv_pixel_t)); @@ -147,14 +147,14 @@ bitmapType *wld_ReadTextureFile(char *filename) gFile = wld_ReadGraphicFile(filename); if (gFile == NULL) - wld_FatalError("Error reading texture %s.", filename); + wld_fatal_error("Error reading texture %s.", filename); /* The height and width should be powers of two for efficient * texture mapping. Here, we enforce this. */ if (wld_Log2(gFile->width) == -1 || wld_Log2(gFile->height) == -1) - wld_FatalError("Dimensions texture %s are not powers of two.", + wld_fatal_error("Dimensions texture %s are not powers of two.", filename); t = wld_NewTexture(gFile->width, gFile->height); diff --git a/graphics/traveler/tools/libwld/wld_realloc.c b/graphics/traveler/tools/libwld/wld_realloc.c index 74f86d5c6..64f1c9a67 100644 --- a/graphics/traveler/tools/libwld/wld_realloc.c +++ b/graphics/traveler/tools/libwld/wld_realloc.c @@ -59,7 +59,7 @@ void *wld_Realloc(void *addr, size_t size) new = realloc(addr, size); if (new == NULL) { - wld_FatalError("out of memory (wtrealloc %x bytes)", size); + wld_fatal_error("out of memory (wtrealloc %x bytes)", size); } return new; } diff --git a/graphics/traveler/tools/libwld/wld_removeplane.c b/graphics/traveler/tools/libwld/wld_removeplane.c index 00be4ccbb..c0d5be307 100644 --- a/graphics/traveler/tools/libwld/wld_removeplane.c +++ b/graphics/traveler/tools/libwld/wld_removeplane.c @@ -48,13 +48,13 @@ *************************************************************************/ /************************************************************************* - * Name: wld_RemovePlane + * Name: wld_remove_plane * Description: * This function removes the specified plane from the world plane list * and "deallocates" it by saving it on the free list ************************************************************************/ -void wld_RemovePlane(rectListType *rect, rectHeadType *list) +void wld_remove_plane(rectListType *rect, rectHeadType *list) { /* Un-hook the backward link to the rect */ diff --git a/graphics/traveler/tools/libwld/wld_utils.h b/graphics/traveler/tools/libwld/wld_utils.h index 547a74e26..376fe684b 100644 --- a/graphics/traveler/tools/libwld/wld_utils.h +++ b/graphics/traveler/tools/libwld/wld_utils.h @@ -48,6 +48,6 @@ *************************************************************************/ int16_t wld_ReadDecimal(FILE *fp); -void wld_FatalError(char *message, ...); +void wld_fatal_error(char *message, ...); #endif /* __APPS_GRAPHICS_TRAVELER_TOOSL_LIBWLD_WLD_UTILS_H */ diff --git a/graphics/traveler/tools/tcledit/tcl_edit.c b/graphics/traveler/tools/tcledit/tcl_edit.c index 1b4b04842..5ce958fc1 100644 --- a/graphics/traveler/tools/tcledit/tcl_edit.c +++ b/graphics/traveler/tools/tcledit/tcl_edit.c @@ -173,7 +173,7 @@ static int astSetEditMode(ClientData clientData, if (argc != 3) { - astFatalError("%s: Unexpected number of arguments: %d\n", + wld_fatal_error("%s: Unexpected number of arguments: %d\n", __FUNCTION__, argc); } else if (strcmp(argv[1], "POS") == 0) @@ -219,14 +219,14 @@ static int astSetEditMode(ClientData clientData, } else { - astFatalError("%s: Unrecognized NEW plane: %s\n", + wld_fatal_error("%s: Unrecognized NEW plane: %s\n", __FUNCTION__, argv[2]); } astUpdateNEWModeDisplay(); } else { - astFatalError("%s: Unrecognized mode: %s\n", + wld_fatal_error("%s: Unrecognized mode: %s\n", __FUNCTION__, argv[1]); } return TCL_OK; @@ -242,7 +242,7 @@ static int astNewPosition(ClientData clientData, if (argc != 4) { - astFatalError("%s: Unexpected number of arguments: %d\n", + wld_fatal_error("%s: Unexpected number of arguments: %d\n", __FUNCTION__, argc); } @@ -267,7 +267,7 @@ static int astNewZoom(ClientData clientData, if (argc != 5) { - astFatalError("%s: Unexpected number of arguments: %d\n", + wld_fatal_error("%s: Unexpected number of arguments: %d\n", __FUNCTION__, argc); } @@ -342,7 +342,7 @@ static int astNewEdit(ClientData clientData, if (argc != 4) { - astFatalError("%s: Unexpected number of arguments: %d\n", + wld_fatal_error("%s: Unexpected number of arguments: %d\n", __FUNCTION__, argc); } @@ -380,7 +380,7 @@ static int astNewEdit(ClientData clientData, } else { - astFatalError("%s: Unrecognized EDITX plane: %s\n", + wld_fatal_error("%s: Unrecognized EDITX plane: %s\n", __FUNCTION__, argv[1]); } break; @@ -405,7 +405,7 @@ static int astNewEdit(ClientData clientData, } else { - astFatalError("%s: Unrecognized EDITY plane: %s\n", + wld_fatal_error("%s: Unrecognized EDITY plane: %s\n", __FUNCTION__, argv[1]); } break; @@ -430,7 +430,7 @@ static int astNewEdit(ClientData clientData, } else { - astFatalError("%s: Unrecognized EDITZ plane: %s\n", + wld_fatal_error("%s: Unrecognized EDITZ plane: %s\n", __FUNCTION__, argv[1]); } break; @@ -456,14 +456,14 @@ static int astNewAttributes(ClientData clientData, if (argc != 4) { - astFatalError("%s: Unexpected number of arguments: %d\n", + wld_fatal_error("%s: Unexpected number of arguments: %d\n", __FUNCTION__, argc); } attributes = argv[1]; if (strlen(attributes) != 3) { - astFatalError("%s: Unexpected attribute string length: %s\n", + wld_fatal_error("%s: Unexpected attribute string length: %s\n", __FUNCTION__, argv[1]); } @@ -535,7 +535,7 @@ static int astAddRectangle(ClientData clientData, if (argc != 1) { - astFatalError("%s: Unexpected number of arguments: %d\n", + wld_fatal_error("%s: Unexpected number of arguments: %d\n", __FUNCTION__, argc); } @@ -545,7 +545,7 @@ static int astAddRectangle(ClientData clientData, { /* Get a new container for the rectangle information */ - rectListType *rect = astNewPlane(); + rectListType *rect = wld_new_plane(); /* Copy the rectangle data into the container */ @@ -556,15 +556,15 @@ static int astAddRectangle(ClientData clientData, switch (editPlane) { case EDITPLANE_X: - astAddPlane(rect, &xPlane); + wld_add_plane(rect, &xPlane); break; case EDITPLANE_Y: - astAddPlane(rect, &yPlane); + wld_add_plane(rect, &yPlane); break; case EDITPLANE_Z: - astAddPlane(rect, &zPlane); + wld_add_plane(rect, &zPlane); break; } } @@ -582,11 +582,11 @@ static int astSaveRectangles(ClientData clientData, if (argc != 1) { - astFatalError("%s: Unexpected number of arguments: %d\n", + wld_fatal_error("%s: Unexpected number of arguments: %d\n", __FUNCTION__, argc); } - astSavePlanes(astOutFileName); + wld_save_planes(astOutFileName); return TCL_OK; } @@ -638,7 +638,7 @@ int main(int argc, char **argv, char **envp) * a valid plaine file. */ - if (astLoadPlaneFile(astInFileName) != PLANE_SUCCESS) + if (wld_load_planefile(astInFileName) != PLANE_SUCCESS) { exit(1); } @@ -721,7 +721,7 @@ int Tcl_AppInit(Tcl_Interp *interp) return TCL_OK; } -void astFatalError(char *message, ...) +void wld_fatal_error(char *message, ...) { va_list args; diff --git a/graphics/traveler/tools/tcledit/tcl_x11graphics.c b/graphics/traveler/tools/tcledit/tcl_x11graphics.c index b4ac64a02..3777a06aa 100644 --- a/graphics/traveler/tools/tcledit/tcl_x11graphics.c +++ b/graphics/traveler/tools/tcledit/tcl_x11graphics.c @@ -114,7 +114,7 @@ void x11_InitGraphics(tcl_window_t *w) printf("Pixel depth is %d bits\n", windowAttributes.depth); if (windowAttributes.depth != 24) { - x11_FatalError("Unsupported pixel depth: %d", windowAttributes.depth); + wld_fatal_error("Unsupported pixel depth: %d", windowAttributes.depth); } x11_LoadPalette(w); @@ -147,7 +147,7 @@ static void x11_CreateWindow(tcl_window_t *w) w->display = XOpenDisplay(NULL); if (w->display == NULL) - x11_FatalError("Unable to open display.\n"); + wld_fatal_error("Unable to open display.\n"); w->screen = DefaultScreen(w->display); @@ -199,7 +199,7 @@ static void x11_LoadPalette(tcl_window_t *w) if (!astAllocateColors(w, cMap)) { printf("failed\n"); - x11_FatalError("Unable to allocate enough color cells."); + wld_fatal_error("Unable to allocate enough color cells."); } XSetWindowColormap(w->display, w->win, cMap); } @@ -335,7 +335,7 @@ static void x11_MapSharedMemory(tcl_window_t *w, int depth) if (!w->image) { - x11_FatalError("Unable to create image."); + wld_fatal_error("Unable to create image."); } shmCheckPoint++; @@ -393,7 +393,7 @@ static void x11_MapSharedMemory(tcl_window_t *w, int depth) if (w->image == NULL) { - x11_FatalError("Unable to create image."); + wld_fatal_error("Unable to create image."); } shmCheckPoint++; }