Upgrading the clist file access with 64 bits file access.
"Igor V. Melichev" <[email protected]> Tue, 5 Sep 2006 18:24:59 +0400
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
------=_NextPart_000_000D_01C6D118.98801930
Content-Type: text/plain; format=flowed; charset="koi8-r"; reply-type=original
Content-Transfer-Encoding: 7bit
This patvh to be applied after
http://ghostscript.com/pipermail/gs-code-review/2006-September/004840.html
[Log message beg]
Upgrading the clist file access with 64 bits file access.
DETAILS :
clist file position variable changed type to int64_t.
EXPECTED DIFFERENCES :
None.
[Log message end]
------=_NextPart_000_000D_01C6D118.98801930
Content-Type: text/plain; format=flowed; name="patch.txt"; reply-type=original
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="patch.txt"
=20
=20
=20
=20
*** F:\SVN-GS\HEAD\gs\src\gxband.h Wed Mar 15 15:04:17 2006=0A=
--- files\gs\src\gxband.h Tue Sep 5 17:38:03 2006=0A=
***************=0A=
*** 63,67 ****=0A=
clist_file_ptr bfile; /* block file, normally 0 */
uint tile_cache_size; /* size of tile cache */
! long bfile_end_pos; /* ftell at end of bfile */
gx_band_params_t band_params; /* parameters used when writing =
band list */
/* (actual values, no 0s) */
--- 63,67 ----=0A=
clist_file_ptr bfile; /* block file, normally 0 */
uint tile_cache_size; /* size of tile cache */
! int64_t bfile_end_pos; /* ftell at end of bfile */
gx_band_params_t band_params; /* parameters used when writing =
band list */
/* (actual values, no 0s) */
=20
=20
=20
*** F:\SVN-GS\HEAD\gs\src\gxcldev.h Wed Mar 15 15:04:44 2006=0A=
--- files\gs\src\gxcldev.h Tue Sep 5 17:53:10 2006=0A=
***************=0A=
*** 216,220 ****=0A=
int band_min, band_max;
#define cmd_band_end (-1) /* end of band file */
! long pos; /* starting position in cfile */
} cmd_block;
=20
--- 216,220 ----=0A=
int band_min, band_max;
#define cmd_band_end (-1) /* end of band file */
! int64_t pos; /* starting position in cfile */
} cmd_block;
=20
=20
=20
=20
*** F:\SVN-GS\HEAD\gs\src\gxclfile.c Wed Mar 15 15:04:34 2006=0A=
--- files\gs\src\gxclfile.c Tue Sep 5 17:32:12 2006=0A=
***************=0A=
*** 37,41 ****=0A=
return_error(gs_error_invalidfileaccess);
*pcf =3D
! (clist_file_ptr) =
gp_open_scratch_file(gp_scratch_file_name_prefix,
fname, fmode);
} else
--- 37,41 ----=0A=
return_error(gs_error_invalidfileaccess);
*pcf =3D
! (clist_file_ptr) =
gp_open_scratch_file_64(gp_scratch_file_name_prefix,
fname, fmode);
} else
***************=0A=
*** 124,131 ****=0A=
}
=20
! long
clist_ftell(clist_file_ptr cf)
{
! return ftell((FILE *) cf);
}
=20
--- 124,131 ----=0A=
}
=20
! int64_t
clist_ftell(clist_file_ptr cf)
{
! return gp_ftell_64((FILE *) cf);
}
=20
***************=0A=
*** 155,160 ****=0A=
=20
int
! clist_fseek(clist_file_ptr cf, long offset, int mode, const char =
*ignore_fname)
{
! return fseek((FILE *) cf, offset, mode);
}
--- 155,160 ----=0A=
=20
int
! clist_fseek(clist_file_ptr cf, int64_t offset, int mode, const char =
*ignore_fname)
{
! return gp_fseek_64((FILE *) cf, offset, mode);
}
=20
=20
=20
*** F:\SVN-GS\HEAD\gs\src\gxclio.h Wed Mar 15 15:05:09 2006=0A=
--- files\gs\src\gxclio.h Tue Sep 5 17:34:09 2006=0A=
***************=0A=
*** 78,82 ****=0A=
int clist_ferror_code(clist_file_ptr cf);
=20
! long clist_ftell(clist_file_ptr cf);
=20
/*
--- 78,82 ----=0A=
int clist_ferror_code(clist_file_ptr cf);
=20
! int64_t clist_ftell(clist_file_ptr cf);
=20
/*
***************=0A=
*** 87,91 ****=0A=
void clist_rewind(clist_file_ptr cf, bool discard_data, const char =
*fname);
=20
! int clist_fseek(clist_file_ptr cf, long offset, int mode, const char =
*fname);
=20
#endif /* gxclio_INCLUDED */
--- 87,91 ----=0A=
void clist_rewind(clist_file_ptr cf, bool discard_data, const char =
*fname);
=20
! int clist_fseek(clist_file_ptr cf, int64_t offset, int mode, const =
char *fname);
=20
#endif /* gxclio_INCLUDED */
=20
=20
=20
*** F:\SVN-GS\HEAD\gs\src\gxclist.c Wed Mar 15 15:04:38 2006=0A=
--- files\gs\src\gxclist.c Tue Sep 5 17:54:16 2006=0A=
***************=0A=
*** 658,662 ****=0A=
if (gs_debug_c('l') | gs_debug_c(':'))
dlprintf2("[:]clist_end_page at cfile=3D%ld, bfile=3D%ld\n",
! cb.pos, cldev->page_bfile_end_pos);
#endif
return 0;
--- 658,662 ----=0A=
if (gs_debug_c('l') | gs_debug_c(':'))
dlprintf2("[:]clist_end_page at cfile=3D%ld, bfile=3D%ld\n",
! (long)cb.pos, (long)cldev->page_bfile_end_pos);
#endif
return 0;
=20
=20
=20
*** F:\SVN-GS\HEAD\gs\src\gxclmem.c Wed Mar 15 15:04:30 2006=0A=
--- files\gs\src\gxclmem.c Tue Sep 5 17:43:46 2006=0A=
***************=0A=
*** 864,868 ****=0A=
}
=20
! long
memfile_ftell(clist_file_ptr cf)
{
--- 864,868 ----=0A=
}
=20
! int64_t
memfile_ftell(clist_file_ptr cf)
{
***************=0A=
*** 887,891 ****=0A=
=20
int
! memfile_fseek(clist_file_ptr cf, long offset, int mode, const char =
*ignore_fname)
{
MEMFILE *f =3D (MEMFILE *) cf;
--- 887,891 ----=0A=
=20
int
! memfile_fseek(clist_file_ptr cf, int64_t offset, int mode, const char =
*ignore_fname)
{
MEMFILE *f =3D (MEMFILE *) cf;
=20
=20
=20
*** F:\SVN-GS\HEAD\gs\src\gxclmem.h Wed Mar 15 15:04:30 2006=0A=
--- files\gs\src\gxclmem.h Tue Sep 5 17:49:28 2006=0A=
***************=0A=
*** 89,98 ****=0A=
LOG_MEMFILE_BLK *log_head;
LOG_MEMFILE_BLK *log_curr_blk;
! long log_length; /* updated during write */
! long log_curr_pos; /* updated during seek, close, read */
char *pdata; /* raw data */
char *pdata_end;
/* physical file properties */
! long total_space; /* so we know when to start compress */
PHYS_MEMFILE_BLK *phys_curr; /* NULL if not compressing */
RAW_BUFFER *raw_head, *raw_tail;
--- 89,98 ----=0A=
LOG_MEMFILE_BLK *log_head;
LOG_MEMFILE_BLK *log_curr_blk;
! int64_t log_length; /* updated during write */
! int64_t log_curr_pos; /* updated during seek, close, read */
char *pdata; /* raw data */
char *pdata_end;
/* physical file properties */
! int64_t total_space; /* so we know when to start compress */
PHYS_MEMFILE_BLK *phys_curr; /* NULL if not compressing */
RAW_BUFFER *raw_head, *raw_tail;
=20
=20
=20
*** F:\SVN-GS\HEAD\gs\src\gxclread.c Wed Mar 15 15:04:42 2006=0A=
--- files\gs\src\gxclread.c Tue Sep 5 17:54:46 2006=0A=
***************=0A=
*** 107,111 ****=0A=
int bmin =3D ss->b_this.band_min;
int bmax =3D ss->b_this.band_max;
! long pos =3D ss->b_this.pos;
=20
clist_fread_chars(&ss->b_this, sizeof(ss->b_this), bfile);
--- 107,111 ----=0A=
int bmin =3D ss->b_this.band_min;
int bmax =3D ss->b_this.band_max;
! int64_t pos =3D ss->b_this.pos;
=20
clist_fread_chars(&ss->b_this, sizeof(ss->b_this), bfile);
***************=0A=
*** 116,121 ****=0A=
if_debug5('l', "[l]reading for bands (%d,%d) at bfile %ld, cfile =
%ld, length %u\n",
bmin, bmax,
! clist_ftell(bfile) - 2 * sizeof(ss->b_this),
! pos, left);
}
}
--- 116,121 ----=0A=
if_debug5('l', "[l]reading for bands (%d,%d) at bfile %ld, cfile =
%ld, length %u\n",
bmin, bmax,
! (long)(clist_ftell(bfile) - 2 * sizeof(ss->b_this)),
! (long)pos, left);
}
}
=20
=20
=20
*** F:\SVN-GS\HEAD\gs\src\gxclutil.c Wed Mar 15 15:04:32 2006=0A=
--- files\gs\src\gxclutil.c Tue Sep 5 17:57:48 2006=0A=
***************=0A=
*** 146,150 ****=0A=
cb.pos =3D clist_ftell(cfile);
if_debug3('l', "[l]writing for bands (%d,%d) at %ld\n",
! band_min, band_max, cb.pos);
clist_fwrite_chars(&cb, sizeof(cb), bfile);
if (cp !=3D 0) {
--- 146,150 ----=0A=
cb.pos =3D clist_ftell(cfile);
if_debug3('l', "[l]writing for bands (%d,%d) at %ld\n",
! band_min, band_max, (long)cb.pos);
clist_fwrite_chars(&cb, sizeof(cb), bfile);
if (cp !=3D 0) {
=20
=20
=20
=20
------=_NextPart_000_000D_01C6D118.98801930
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
------=_NextPart_000_000D_01C6D118.98801930--