Revision: 71994 http://sourceforge.net/p/brlcad/code/71994 Author: starseeker Date: 2018-11-08 20:56:06 +0000 (Thu, 08 Nov 2018) Log Message: ----------- ftell looks like it may be the more problematic case here - see if we can use just bu_ftell and go with the define trick for fseek
Modified Paths: -------------- brlcad/trunk/bench/pixcmp.c brlcad/trunk/include/bu/file.h brlcad/trunk/include/config_win.h.in brlcad/trunk/src/anim/anim_sort.c brlcad/trunk/src/conv/asc/asc2g.c brlcad/trunk/src/conv/dxf/dxf-g.c brlcad/trunk/src/conv/fast4-g.c brlcad/trunk/src/conv/g-acad.c brlcad/trunk/src/conv/iges/findp.c brlcad/trunk/src/conv/iges/g-iges.c brlcad/trunk/src/conv/iges/readrec.c brlcad/trunk/src/conv/iges/recsize.c brlcad/trunk/src/conv/nastran-g.c brlcad/trunk/src/conv/vdeck/vdeck.c brlcad/trunk/src/fbed/char.c brlcad/trunk/src/lgt/char.c brlcad/trunk/src/lgt/ir.c brlcad/trunk/src/lgt/octree.c brlcad/trunk/src/libbu/file.c brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c brlcad/trunk/src/libicv/rot.c brlcad/trunk/src/librt/db_corrupt.c brlcad/trunk/src/librt/db_io.c brlcad/trunk/src/librt/db_scan.c brlcad/trunk/src/librt/primitives/primitive_util.c brlcad/trunk/src/rt/do.c brlcad/trunk/src/rt/view.c brlcad/trunk/src/util/ap-pix.c brlcad/trunk/src/util/bwcrop.c brlcad/trunk/src/util/bwhisteq.c brlcad/trunk/src/util/bwrot.c brlcad/trunk/src/util/bwscale.c brlcad/trunk/src/util/hex.c brlcad/trunk/src/util/pixcrop.c brlcad/trunk/src/util/pixrot.c brlcad/trunk/src/util/pixscale.c Modified: brlcad/trunk/bench/pixcmp.c =================================================================== --- brlcad/trunk/bench/pixcmp.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/bench/pixcmp.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -215,7 +215,7 @@ } /* skip requested pixels/bytes in FILE1 */ - if (f1_skip && bu_fseek(f1, f1_skip, SEEK_SET)) { + if (f1_skip && fseek(f1, f1_skip, SEEK_SET)) { bu_log("ERROR: Unable to seek %zd %s%s in FILE1\n", f1_skip, print_bytes?"byte":"pixel", @@ -225,7 +225,7 @@ } /* skip requested pixels in FILE2 */ - if (f2_skip && bu_fseek(f2, f2_skip, SEEK_SET)) { + if (f2_skip && fseek(f2, f2_skip, SEEK_SET)) { bu_log("ERROR: Unable to seek %zd %s%s in FILE2\n", f1_skip, print_bytes?"byte":"pixel", Modified: brlcad/trunk/include/bu/file.h =================================================================== --- brlcad/trunk/include/bu/file.h 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/include/bu/file.h 2018-11-08 20:56:06 UTC (rev 71994) @@ -171,9 +171,12 @@ BU_EXPORT extern char *bu_file_realpath(const char *path, char *resolved_path); -/** NEW: Do not use. */ -BU_EXPORT extern int bu_fseek(FILE *stream, off_t offset, int origin); -/** NEW: Do not use. */ +/** + * This wrapper appears to be necessary (at least on Visual Studio) to handle + * situations where 32 and 64 bit versions of this function have different + * function signatures (a simple define of the 32 bit version to the 64 bit + * version will produce compile errors.) + */ BU_EXPORT extern off_t bu_ftell(FILE *stream); /** @} */ Modified: brlcad/trunk/include/config_win.h.in =================================================================== --- brlcad/trunk/include/config_win.h.in 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/include/config_win.h.in 2018-11-08 20:56:06 UTC (rev 71994) @@ -212,6 +212,13 @@ # define lseek _lseek #endif +/* set up fseek */ +#if defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8 +# define fseek _fseeki64 +#else +# define fseek _fseek +#endif + #cmakedefine fmax __max #define ioctl ioctlsocket Modified: brlcad/trunk/src/anim/anim_sort.c =================================================================== --- brlcad/trunk/src/anim/anim_sort.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/anim/anim_sort.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -134,9 +134,9 @@ number = -1; success = 0; /* tells whether or not any frames have been found which have the current frame number*/ if (incremental) { - bu_fseek(stdin, 0, 0); + fseek(stdin, 0, 0); } else { - bu_fseek(stdin, last_pos, 0); + fseek(stdin, last_pos, 0); } reserve = MAXLEN*MAXLINES; Modified: brlcad/trunk/src/conv/asc/asc2g.c =================================================================== --- brlcad/trunk/src/conv/asc/asc2g.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/conv/asc/asc2g.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -1065,7 +1065,7 @@ pg->max_npts = 0; /* Return to first 'Q' record */ - bu_fseek(ifp, startpos, 0); + fseek(ifp, startpos, 0); for (nlines = 0; nlines < pg->npoly; nlines++) { struct rt_pg_face_internal *fp = &pg->poly[nlines]; Modified: brlcad/trunk/src/conv/dxf/dxf-g.c =================================================================== --- brlcad/trunk/src/conv/dxf/dxf-g.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/conv/dxf/dxf-g.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -1109,7 +1109,7 @@ break; } bu_free((char *)tmp_state, "curr_state"); - bu_fseek(dxf, curr_state->file_offset, SEEK_SET); + fseek(dxf, curr_state->file_offset, SEEK_SET); curr_state->sub_state = UNKNOWN_ENTITY_STATE; if (verbose) { bu_log("Popped state at end of inserted block (seeked to %ld)\n", curr_state->file_offset); @@ -1223,7 +1223,7 @@ BU_LIST_PUSH(&state_stack, &(curr_state->l)); curr_state = new_state; new_state = NULL; - bu_fseek(dxf, curr_state->curr_block->offset, SEEK_SET); + fseek(dxf, curr_state->curr_block->offset, SEEK_SET); curr_state->state = ENTITIES_SECTION; curr_state->sub_state = UNKNOWN_ENTITY_STATE; if (verbose) { @@ -2504,7 +2504,7 @@ BU_LIST_PUSH(&state_stack, &(curr_state->l)); curr_state = new_state; new_state = NULL; - bu_fseek(dxf, curr_state->curr_block->offset, SEEK_SET); + fseek(dxf, curr_state->curr_block->offset, SEEK_SET); curr_state->state = ENTITIES_SECTION; curr_state->sub_state = UNKNOWN_ENTITY_STATE; if (verbose) { Modified: brlcad/trunk/src/conv/fast4-g.c =================================================================== --- brlcad/trunk/src/conv/fast4-g.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/conv/fast4-g.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -2095,7 +2095,7 @@ } } /* seek to start of the section */ - bu_fseek(fpin, section_start, SEEK_SET); + fseek(fpin, section_start, SEEK_SET); } Modified: brlcad/trunk/src/conv/g-acad.c =================================================================== --- brlcad/trunk/src/conv/g-acad.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/conv/g-acad.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -649,7 +649,7 @@ /* Write out number of facet entities to .facet file */ rewind(fp); - bu_fseek(fp, 46, 0); /* Re-position pointer to 2nd line */ + fseek(fp, 46, 0); /* Re-position pointer to 2nd line */ fprintf(fp, "%d\n", regions_written); /* Write out number of regions */ fclose(fp); Modified: brlcad/trunk/src/conv/iges/findp.c =================================================================== --- brlcad/trunk/src/conv/iges/findp.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/conv/iges/findp.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -44,7 +44,7 @@ saverec = currec; /* save current record number */ - if (bu_fseek(fd, 0, 2)) { + if (fseek(fd, 0, 2)) { /* go to end of file */ bu_log("Cannot seek to end of file\n"); perror("Findp"); Modified: brlcad/trunk/src/conv/iges/g-iges.c =================================================================== --- brlcad/trunk/src/conv/iges/g-iges.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/conv/iges/g-iges.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -402,7 +402,7 @@ if (!multi_file) { /* Copy the parameter section from the temporary file to the output file */ - if ((bu_fseek(fp_param, 0, 0))) { + if ((fseek(fp_param, 0, 0))) { perror("g-iges"); bu_exit(1, "Cannot seek to start of temporary file\n"); } @@ -619,7 +619,7 @@ char copy_buffer[CP_BUF_SIZE] = {0}; /* Copy the parameter section from the temporary file to the output file */ - if ((bu_fseek(fp_param, 0, 0))) { + if ((fseek(fp_param, 0, 0))) { perror("g-iges"); bu_exit(1, "Cannot seek to start of temporary file\n"); } Modified: brlcad/trunk/src/conv/iges/readrec.c =================================================================== --- brlcad/trunk/src/conv/iges/readrec.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/conv/iges/readrec.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -44,7 +44,7 @@ currec = recno; offset = (recno - 1) * reclen; - if (bu_fseek(fd, offset, 0)) { + if (fseek(fd, offset, 0)) { bu_log("Error in seek\n"); perror("Readrec"); bu_exit(1, NULL); Modified: brlcad/trunk/src/conv/iges/recsize.c =================================================================== --- brlcad/trunk/src/conv/iges/recsize.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/conv/iges/recsize.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -68,7 +68,7 @@ if (k == (-1)) /* We didn't encounter an early EOF */ k = NRECS; - if (bu_fseek(fd, 0, 0)) { + if (fseek(fd, 0, 0)) { /* rewind file */ bu_log("Cannot rewind file\n"); perror("Recsize"); Modified: brlcad/trunk/src/conv/nastran-g.c =================================================================== --- brlcad/trunk/src/conv/nastran-g.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/conv/nastran-g.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -161,7 +161,7 @@ for (i=0; i < 20; i++) prev_rec[i][0] = '\0'; - bu_fseek(fpin, start_off, SEEK_SET); + fseek(fpin, start_off, SEEK_SET); line_count = bulk_data_start_line; tmp = bu_fgets(next_line, MAX_LINE_SIZE, fpin); @@ -1219,7 +1219,7 @@ nmg_model = (struct model *)NULL; /* count grid points */ - bu_fseek(fptmp, 0, SEEK_SET); + fseek(fptmp, 0, SEEK_SET); while (bu_fgets(line, MAX_LINE_SIZE, fptmp)) { if (!bu_strncmp(line, "GRID", 4)) grid_count++; @@ -1229,7 +1229,7 @@ } /* get default values and properties */ - bu_fseek(fptmp, 0, SEEK_SET); + fseek(fptmp, 0, SEEK_SET); while (get_next_record(fptmp, 1, 0)) { if (!bu_strncmp(curr_rec[0], "BAROR", 5)) { /* get BAR defaults */ @@ -1262,7 +1262,7 @@ g_pts = (struct grid_point *)bu_calloc(grid_count, sizeof(struct grid_point), "grid points"); /* get all grid points */ - bu_fseek(fptmp, 0, SEEK_SET); + fseek(fptmp, 0, SEEK_SET); while (get_next_record(fptmp, 1, 0)) { int gid; int cid; @@ -1287,7 +1287,7 @@ /* find coordinate systems */ - bu_fseek(fptmp, 0, SEEK_SET); + fseek(fptmp, 0, SEEK_SET); while (get_next_record(fptmp, 1, 0)) { if (bu_strncmp(curr_rec[0], "CORD", 4)) continue; @@ -1306,7 +1306,7 @@ mk_id(fpout, nastran_file); /* get elements */ - bu_fseek(fptmp, 0, SEEK_SET); + fseek(fptmp, 0, SEEK_SET); while (get_next_record(fptmp, 1, 0)) { if (!bu_strncmp(curr_rec[0], "CBAR", 4)) get_cbar(); Modified: brlcad/trunk/src/conv/vdeck/vdeck.c =================================================================== --- brlcad/trunk/src/conv/vdeck/vdeck.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/conv/vdeck/vdeck.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -1272,7 +1272,7 @@ /* Go back, and add number of solids and regions on second card. */ if (savsol >= 0) - bu_fseek(solfp, savsol, 0); + fseek(solfp, savsol, 0); itoa(nns, buff, 5); ewrite(solfp, buff, 5); Modified: brlcad/trunk/src/fbed/char.c =================================================================== --- brlcad/trunk/src/fbed/char.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/fbed/char.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -70,7 +70,7 @@ char_id = (int) line[char_count] & 0377; /* locate the bitmap for the character in the file */ - if (bu_fseek(font.ffdes, SWABV(font.dir[char_id].addr) + font.offset, 0) == EOF) { + if (fseek(font.ffdes, SWABV(font.dir[char_id].addr) + font.offset, 0) == EOF) { fb_log("fseek() to %zd failed.\n", (SWABV(font.dir[char_id].addr) + font.offset)); return; Modified: brlcad/trunk/src/lgt/char.c =================================================================== --- brlcad/trunk/src/lgt/char.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/lgt/char.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -70,7 +70,7 @@ } /* locate the bitmap for the character in the file */ - if (bu_fseek(font.ffdes, SWABV(font.dir[char_id].addr)+font.offset, 0) == EOF) { + if (fseek(font.ffdes, SWABV(font.dir[char_id].addr)+font.offset, 0) == EOF) { bu_log("fseek() to %zd failed.\n", (SWABV(font.dir[char_id].addr) + font.offset) ); Modified: brlcad/trunk/src/lgt/ir.c =================================================================== --- brlcad/trunk/src/lgt/ir.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/lgt/ir.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -152,7 +152,7 @@ static int get_IR(int x, int y, int *fahp, FILE *fp) { - if (bu_fseek(fp, (y*IR_DATA_WID + x)*sizeof(int), 0) != 0) + if (fseek(fp, (y*IR_DATA_WID + x)*sizeof(int), 0) != 0) return 0; else if (fread((char *) fahp, (int) sizeof(int), 1, fp) != 1) Modified: brlcad/trunk/src/lgt/octree.c =================================================================== --- brlcad/trunk/src/lgt/octree.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/lgt/octree.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -337,7 +337,7 @@ } if (hdr_ptlist.f_length > 0) { /* Go back and fudge point count. */ - if (bu_fseek(fp, addr, 0)) { + if (fseek(fp, addr, 0)) { bu_log("\"%s\"(%d) Fseek failed.\n", __FILE__, __LINE__); return 0; } @@ -349,7 +349,7 @@ return 0; } /* Re-position write pointer to end-of-file. */ - if (bu_fseek(fp, 0, 2)) { + if (fseek(fp, 0, 2)) { bu_log("\"%s\"(%d) Fseek failed.\n", __FILE__, __LINE__); return 0; } Modified: brlcad/trunk/src/libbu/file.c =================================================================== --- brlcad/trunk/src/libbu/file.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/libbu/file.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -384,22 +384,6 @@ return 1; } - -int -bu_fseek(FILE *stream, off_t offset, int origin) -{ - int ret; - -#if defined(HAVE__FSEEKI64) && defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8 - ret = _fseeki64(stream, offset, origin); -#else - ret = fseek(stream, offset, origin); -#endif - - return ret; -} - - off_t bu_ftell(FILE *stream) { Modified: brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c =================================================================== --- brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -2189,7 +2189,7 @@ } } /* seek to start of the section */ - bu_fseek(pstate->fpin, section_start, SEEK_SET); + fseek(pstate->fpin, section_start, SEEK_SET); } Modified: brlcad/trunk/src/libicv/rot.c =================================================================== --- brlcad/trunk/src/libicv/rot.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/libicv/rot.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -351,7 +351,7 @@ xout = (nyin - 1) - lasty; outbyte = ((yout * nyin) + xout) * pixbytes; if (outplace != outbyte) { - if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) { + if (fseek(ofp, outbyte, SEEK_SET) < 0) { ret = 3; perror("fseek"); bu_log("ERROR: %s can't seek on output (ofp=%p, outbyte=%zd)\n", argv[0], (void *)ofp, outbyte); @@ -381,7 +381,7 @@ xout = yin; outbyte = ((yout * nyin) + xout) * pixbytes; if (outplace != outbyte) { - if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) { + if (fseek(ofp, outbyte, SEEK_SET) < 0) { ret = 3; perror("fseek"); bu_log("ERROR: %s can't seek on output (ofp=%p, outbyte=%zd)\n", argv[0], (void *)ofp, outbyte); @@ -403,7 +403,7 @@ yout = (nyin - 1) - y + 1; outbyte = yout * scanbytes; if (outplace != outbyte) { - if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) { + if (fseek(ofp, outbyte, SEEK_SET) < 0) { ret = 3; perror("fseek"); bu_log("ERROR: %s can't seek on output (ofp=%p, outbyte=%zd)\n", argv[0], (void *)ofp, outbyte); Modified: brlcad/trunk/src/librt/db_corrupt.c =================================================================== --- brlcad/trunk/src/librt/db_corrupt.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/librt/db_corrupt.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -54,7 +54,7 @@ RT_CK_DBI(dbip); /* get into position */ - ret = bu_fseek(dbip->dbi_fp, offset, 0); + ret = fseek(dbip->dbi_fp, offset, 0); if (ret) { bu_log("Database seek failure, unable to seek [%s]\n", name); return 0; Modified: brlcad/trunk/src/librt/db_io.c =================================================================== --- brlcad/trunk/src/librt/db_io.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/librt/db_io.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -78,7 +78,7 @@ } bu_semaphore_acquire(BU_SEM_SYSCALL); - ret = bu_fseek(dbip->dbi_fp, offset, 0); + ret = fseek(dbip->dbi_fp, offset, 0); if (ret) bu_bomb("db_read: fseek error\n"); got = (size_t)fread(addr, 1, count, dbip->dbi_fp); @@ -192,7 +192,7 @@ bu_semaphore_acquire(BU_SEM_SYSCALL); bu_interrupt_suspend(); - (void)bu_fseek(dbip->dbi_fp, offset, 0); + (void)fseek(dbip->dbi_fp, offset, 0); got = fwrite(addr, 1, count, dbip->dbi_fp); fflush(dbip->dbi_fp); Modified: brlcad/trunk/src/librt/db_scan.c =================================================================== --- brlcad/trunk/src/librt/db_scan.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/librt/db_scan.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -108,7 +108,7 @@ totrec = 0; while (1) { nrec = 0; - if (bu_fseek(dbip->dbi_fp, next, 0) != 0) { + if (fseek(dbip->dbi_fp, next, 0) != 0) { bu_log("db_scan: fseek(offset=%zd) failure\n", next); return -1; } @@ -149,7 +149,7 @@ break; DEBUG_PR(here, rec2); if (rec2.u_id != ID_ARS_B) { - bu_fseek(dbip->dbi_fp, here, 0); + fseek(dbip->dbi_fp, here, 0); break; } nrec++; @@ -194,7 +194,7 @@ break; DEBUG_PR(here, rec2); if (rec2.u_id != ID_P_DATA) { - bu_fseek(dbip->dbi_fp, here, 0); + fseek(dbip->dbi_fp, here, 0); break; } nrec++; @@ -213,7 +213,7 @@ break; DEBUG_PR(here, rec2); if (rec2.u_id != ID_BSURF) { - bu_fseek(dbip->dbi_fp, here, 0); + fseek(dbip->dbi_fp, here, 0); break; } @@ -315,7 +315,7 @@ break; DEBUG_PR(here, rec2); if (rec2.u_id != ID_MEMB) { - bu_fseek(dbip->dbi_fp, here, 0); + fseek(dbip->dbi_fp, here, 0); break; } nrec++; Modified: brlcad/trunk/src/librt/primitives/primitive_util.c =================================================================== --- brlcad/trunk/src/librt/primitives/primitive_util.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/librt/primitives/primitive_util.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -528,7 +528,7 @@ if (!fp) bu_exit(-1, "failed to read OpenCL code file (%s)\n", filename); fseek(fp, 0, SEEK_END); - *length = ftell(fp); + *length = bu_ftell(fp); rewind(fp); data = (char*)bu_malloc((*length+1)*sizeof(char), "failed bu_malloc() in clt_read_code()"); Modified: brlcad/trunk/src/rt/do.c =================================================================== --- brlcad/trunk/src/rt/do.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/rt/do.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -613,7 +613,7 @@ } if (outfp) { bu_semaphore_acquire(BU_SEM_SYSCALL); - if (bu_fseek(outfp, cur_pixel*clt_o[1], 0) != 0) + if (fseek(outfp, cur_pixel*clt_o[1], 0) != 0) fprintf(stderr, "fseek error\n"); if (fwrite(pixelp, size, 1, outfp) != 1) bu_exit(EXIT_FAILURE, "pixel fwrite error"); Modified: brlcad/trunk/src/rt/view.c =================================================================== --- brlcad/trunk/src/rt/view.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/rt/view.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -306,7 +306,7 @@ icv_writepixel(bif, ap->a_x, ap->a_y, ap->a_color); } else if (outfp != NULL) { bu_semaphore_acquire(BU_SEM_SYSCALL); - if (bu_fseek(outfp, (ap->a_y*width*pwidth) + (ap->a_x*pwidth), 0) != 0) + if (fseek(outfp, (ap->a_y*width*pwidth) + (ap->a_x*pwidth), 0) != 0) fprintf(stderr, "fseek error\n"); if (fwrite(p, 3, 1, outfp) != 1) bu_exit(EXIT_FAILURE, "pixel fwrite error"); @@ -512,7 +512,7 @@ size_t count; bu_semaphore_acquire(BU_SEM_SYSCALL); - if (bu_fseek(outfp, ap->a_y*width*pwidth, 0) != 0) + if (fseek(outfp, ap->a_y*width*pwidth, 0) != 0) fprintf(stderr, "fseek error\n"); count = fwrite(scanline[ap->a_y].sl_buf, sizeof(char), width*pwidth, outfp); Modified: brlcad/trunk/src/util/ap-pix.c =================================================================== --- brlcad/trunk/src/util/ap-pix.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/util/ap-pix.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -80,9 +80,9 @@ bu_exit(2, "%s: can't open \"%s\"\n", argv0, argv[1]); } yelfp = fopen(argv[1], "r"); - bu_fseek(yelfp, 50*sizeof(yelline), 0); + fseek(yelfp, 50*sizeof(yelline), 0); cyafp = fopen(argv[1], "r"); - bu_fseek(cyafp, 100*sizeof(cyaline), 0); + fseek(cyafp, 100*sizeof(cyaline), 0); line = 0; while ((int)fread(&cyaline, sizeof(cyaline), 1, cyafp) > 0) { Modified: brlcad/trunk/src/util/bwcrop.c =================================================================== --- brlcad/trunk/src/util/bwcrop.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/util/bwcrop.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -103,7 +103,7 @@ if (buf_start < 0) buf_start = 0; - bu_fseek(ifp, buf_start * scanlen, 0); + fseek(ifp, buf_start * scanlen, 0); ret = fread(buffer, scanlen, buflines, ifp); if (ret == 0) perror("fread"); Modified: brlcad/trunk/src/util/bwhisteq.c =================================================================== --- brlcad/trunk/src/util/bwhisteq.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/util/bwhisteq.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -105,7 +105,7 @@ fprintf(stderr, "result[%d] = %d\n", i, result[i]); } - bu_fseek(fp, 0, 0); + fseek(fp, 0, 0); while ((n = fread(buf, 1, BUFSIZE, fp)) > 0) { for (i = 0; i < n; i++) { long idx = buf[i]; Modified: brlcad/trunk/src/util/bwrot.c =================================================================== --- brlcad/trunk/src/util/bwrot.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/util/bwrot.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -358,7 +358,7 @@ xout = (nyin - 1) - lasty; outbyte = ((yout * nyin) + xout) * pixbytes; if (outplace != outbyte) { - if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) { + if (fseek(ofp, outbyte, SEEK_SET) < 0) { ret = 3; perror("fseek"); bu_log("ERROR: %s can't seek on output (ofp=%p, outbyte=%zd)\n", bu_getprogname(), (void *)ofp, outbyte); @@ -384,7 +384,7 @@ xout = yin; outbyte = ((yout * nyin) + xout) * pixbytes; if (outplace != outbyte) { - if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) { + if (fseek(ofp, outbyte, SEEK_SET) < 0) { ret = 3; perror("fseek"); bu_log("ERROR: %s can't seek on output (ofp=%p, outbyte=%zd)\n", bu_getprogname(), (void *)ofp, outbyte); @@ -402,7 +402,7 @@ yout = (nyin - 1) - y + 1; outbyte = yout * scanbytes; if (outplace != outbyte) { - if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) { + if (fseek(ofp, outbyte, SEEK_SET) < 0) { ret = 3; perror("fseek"); bu_log("ERROR: %s can't seek on output (ofp=%p, outbyte=%zd)\n", bu_getprogname(), (void *)ofp, outbyte); Modified: brlcad/trunk/src/util/bwscale.c =================================================================== --- brlcad/trunk/src/util/bwscale.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/util/bwscale.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -87,7 +87,7 @@ buf_start = y - buflines/2; if (buf_start < 0) buf_start = 0; - if (bu_fseek(buffp, buf_start * scanlen, 0) < 0) { + if (fseek(buffp, buf_start * scanlen, 0) < 0) { fprintf(stderr, "bwscale: Can't seek to input pixel!\n"); /* bu_exit (3, NULL); */ } Modified: brlcad/trunk/src/util/hex.c =================================================================== --- brlcad/trunk/src/util/hex.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/util/hex.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -63,7 +63,7 @@ if (offset != 0) { /* skip over "offset" bytes first */ - if (bu_fseek(fd, offset, 0)) { + if (fseek(fd, offset, 0)) { /* If fseek fails, try reading our way to the desired offset. * The fseek will fail if we're reading from a pipe. Modified: brlcad/trunk/src/util/pixcrop.c =================================================================== --- brlcad/trunk/src/util/pixcrop.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/util/pixcrop.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -102,7 +102,7 @@ buf_start = y - buflines/2; if (buf_start < 0) buf_start = 0; - bu_fseek(ifp, 0, 0); + fseek(ifp, 0, 0); ret = fread(buffer, scanlen, 3*buflines, ifp); if (ret == 0) perror("fread"); Modified: brlcad/trunk/src/util/pixrot.c =================================================================== --- brlcad/trunk/src/util/pixrot.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/util/pixrot.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -190,7 +190,7 @@ xout = (nyin - 1) - lasty; outbyte = ((yout * nyin) + xout) * pixbytes; if (outplace != outbyte) { - if (bu_fseek(ofp, outbyte, 0) < 0) { + if (fseek(ofp, outbyte, 0) < 0) { bu_exit(3, "pixrot: Can't seek on output, yet I need to!\n"); } outplace = outbyte; @@ -215,7 +215,7 @@ xout = yin; outbyte = ((yout * nyin) + xout) * pixbytes; if (outplace != outbyte) { - if (bu_fseek(ofp, outbyte, 0) < 0) { + if (fseek(ofp, outbyte, 0) < 0) { bu_exit(3, "pixrot: Can't seek on output, yet I need to!\n"); } outplace = outbyte; @@ -232,7 +232,7 @@ yout = (nyin - 1) - y; outbyte = yout * scanbytes; if (outplace != outbyte) { - if (bu_fseek(ofp, outbyte, 0) < 0) { + if (fseek(ofp, outbyte, 0) < 0) { bu_exit(3, "pixrot: Can't seek on output, yet I need to!\n"); } outplace = outbyte; Modified: brlcad/trunk/src/util/pixscale.c =================================================================== --- brlcad/trunk/src/util/pixscale.c 2018-11-08 20:23:59 UTC (rev 71993) +++ brlcad/trunk/src/util/pixscale.c 2018-11-08 20:56:06 UTC (rev 71994) @@ -90,7 +90,7 @@ if (buf_start < 0) buf_start = 0; if (file_pos != buf_start * scanlen) { - if (bu_fseek(buffp, buf_start * scanlen, 0) < 0) { + if (fseek(buffp, buf_start * scanlen, 0) < 0) { bu_exit(3, "pixscale: Can't seek to input pixel! y=%d\n", y); } file_pos = buf_start * scanlen; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits