http://code.google.com/p/perl-devel-nytprof/source/detail?r=1002
Modified:
/trunk/Changes
/trunk/FileHandle.xs
/trunk/NYTProf.xs
=======================================
--- /trunk/Changes Mon Dec 28 03:52:34 2009
+++ /trunk/Changes Mon Dec 28 13:49:46 2009
@@ -15,10 +15,12 @@
=head2 Changes in Devel::NYTProf 3.01
+ Fixed (removed) use of vfscanf() which broke on Windows.
Fixed version number in nytprofmerge.
- Fixed typos in docs thanks to Jonathan Yu.
+
Added documentation to nytprofcg and nytprofmerge.
- Minor updates to nytprofcsv documentation.
+ Updated docs to fix assorted typos, thanks to Jonathan Yu.
+ Updated nytprofcsv documentation.
=head2 Changes in Devel::NYTProf 3.00 (svn r998) 24th Dec 2009
=======================================
--- /trunk/FileHandle.xs Fri Dec 18 13:05:51 2009
+++ /trunk/FileHandle.xs Mon Dec 28 13:49:46 2009
@@ -458,20 +458,6 @@
}
#endif
}
-
-int
-NYTP_scanf(NYTP_file ofile, const char *format, ...) {
- int retval;
- va_list args;
-
- CROAK_IF_NOT_STDIO(ofile, "NYTP_scanf");
-
- va_start(args, format);
- retval = vfscanf(ofile->file, format, args);
- va_end(args);
-
- return retval;
-}
int
NYTP_printf(NYTP_file ofile, const char *format, ...) {
=======================================
--- /trunk/NYTProf.xs Sun Dec 20 15:44:19 2009
+++ /trunk/NYTProf.xs Mon Dec 28 13:49:46 2009
@@ -3451,20 +3451,25 @@
SV *cb_TIME_LINE_tag = NULL;
SV *cb_args[12]; /* must be large enough for the largest callback
argument list */
- av_extend(fid_fileinfo_av, 64); /* grow it up front. */
+ av_extend(fid_fileinfo_av, 64); /* grow them up front. */
av_extend(fid_srclines_av, 64);
av_extend(fid_line_time_av, 64);
- if (2 != NYTP_scanf(in, "NYTProf %d %d\n", &file_major, &file_minor)) {
- croak("NYTProf data format error while parsing header");
- }
- if (file_major != 3)
- croak("NYTProf data format version %d.%d is not supported by
NYTProf %s (which expects version %d.%d)",
- file_major, file_minor, XS_VERSION, NYTP_FILE_MAJOR_VERSION,
NYTP_FILE_MINOR_VERSION);
-
- if (file_minor > NYTP_FILE_MINOR_VERSION)
- warn("NYTProf data format version %d.%d is newer than that
understood by this NYTProf %s, so errors are likely",
- file_major, file_minor, XS_VERSION);
+ if (1) {
+ char header[7+1+3+1+3+1+1];
+
+ if (NULL == NYTP_gets(in, header, sizeof(header)))
+ croak("NYTProf data format error while reading header");
+ if (2 != sscanf(header, "NYTProf %d %d\n", &file_major,
&file_minor))
+ croak("NYTProf data format error while parsing header");
+ if (file_major != 3)
+ croak("NYTProf data format version %d.%d is not supported by
NYTProf %s (which expects version %d.%d)",
+ file_major, file_minor, XS_VERSION,
NYTP_FILE_MAJOR_VERSION, NYTP_FILE_MINOR_VERSION);
+
+ if (file_minor > NYTP_FILE_MINOR_VERSION)
+ warn("NYTProf data format version %d.%d is newer than that
understood by this NYTProf %s, so errors are likely",
+ file_major, file_minor, XS_VERSION);
+ }
if (cb && SvROK(cb)) {
input_chunk_seqn_sv = save_scalar(gv_fetchpv(".", GV_ADD, SVt_IV));