Revision: 1160
Author: dubiously
Date: Wed Mar 10 16:26:20 2010
Log: Add casts for 32/64 bit mismatches
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1160

Modified:
 /trunk/FileHandle.xs
 /trunk/NYTProf.xs

=======================================
--- /trunk/FileHandle.xs        Wed Mar 10 14:35:43 2010
+++ /trunk/FileHandle.xs        Wed Mar 10 16:26:20 2010
@@ -364,7 +364,7 @@
 #endif
     CROAK_IF_NOT_STDIO(ifile, "NYTP_gets");

-    while(fgets(buffer + prev_len, len - prev_len, ifile->file)) {
+    while(fgets(buffer + prev_len, (int)(len - prev_len), ifile->file)) {
         /* We know that there are no '\0' bytes in the part we've already
            read, so don't bother running strlen() over that part.  */
         char *end = buffer + prev_len + strlen(buffer + prev_len);
=======================================
--- /trunk/NYTProf.xs   Wed Mar 10 14:35:43 2010
+++ /trunk/NYTProf.xs   Wed Mar 10 16:26:20 2010
@@ -611,7 +611,7 @@
         NYTP_write_new_fid(out, fid_info->id, fid_info->eval_fid,
                            fid_info->eval_line_num, fid_info->fid_flags,
                            fid_info->file_size, fid_info->file_mtime,
-                           file_name_copy, file_name_len);
+                           file_name_copy, (I32)file_name_len);
         Safefree(file_name_copy);
         return;
     }
@@ -620,7 +620,7 @@
     NYTP_write_new_fid(out, fid_info->id, fid_info->eval_fid,
                        fid_info->eval_line_num, fid_info->fid_flags,
                        fid_info->file_size, fid_info->file_mtime,
-                       file_name, file_name_len);
+                       file_name, (I32)file_name_len);
 }


@@ -1678,7 +1678,7 @@
memcpy(SvPVX(fullnamesv) + pkg_len, "::BEGIN", 7 + 1); /* + 1 for '\0' */
     SvCUR_set(fullnamesv, total_len);
     SvPOK_on(fullnamesv);
-    DBsv = hv_delete(GvHV(PL_DBsub), SvPVX(fullnamesv), total_len, 1);
+    DBsv = hv_delete(GvHV(PL_DBsub), SvPVX(fullnamesv), (I32)total_len, 1);

     if (DBsv && parse_DBsub_value(aTHX_ DBsv, NULL, &line, NULL)) {
         SvREFCNT_inc(DBsv); /* was made mortal by hv_delete */
@@ -1689,7 +1689,7 @@
            a *printf function.  */
sv_catpvn(subr_entry->called_subnam_sv, SvPVX(fullnamesv) + total_len,
                   SvCUR(fullnamesv) - total_len);
- (void) hv_store(GvHV(PL_DBsub), SvPV_nolen(fullnamesv), SvCUR(fullnamesv), DBsv, 0); + (void) hv_store(GvHV(PL_DBsub), SvPV_nolen(fullnamesv), (I32)SvCUR(fullnamesv), DBsv, 0);
     }
     SvREFCNT_dec(fullnamesv);
 }
@@ -1833,7 +1833,7 @@
     } STMT_END;

/* { called_subname => { "caller_subname[fid:line]" => [ count, incl_time, ... ] } } */ - sv_tmp = *hv_fetch(sub_callers_hv, called_subname_pv, called_subname_pv_end - called_subname_pv, 1); + sv_tmp = *hv_fetch(sub_callers_hv, called_subname_pv, (I32)(called_subname_pv_end - called_subname_pv), 1);

if (!SvROK(sv_tmp)) { /* autoviv hash ref - is first call of this called subname from anywhere */
         HV *hv = newHV();
@@ -1854,7 +1854,7 @@
                     * The reader can try to associate the xsubs with the
* corresonding .pm file using the package part of the subname.
                     */
- SV *sv = *hv_fetch(GvHV(PL_DBsub), called_subname_pv, called_subname_pv_end - called_subname_pv, 1); + SV *sv = *hv_fetch(GvHV(PL_DBsub), called_subname_pv, (I32)(called_subname_pv_end - called_subname_pv), 1);
                 if (!SvOK(sv))
                     sv_setpvs(sv, ":0-0"); /* empty file name */
                 if (trace_level >= 2)
@@ -2078,7 +2078,7 @@
         get_time_of_day(subr_entry->initial_call_timeofday);
     subr_entry->initial_overhead_ticks = cumulative_overhead_ticks;
     subr_entry->initial_subr_secs      = cumulative_subr_secs;
-    subr_entry->subr_call_seqn         = ++cumulative_subr_seqn;
+ subr_entry->subr_call_seqn = (unsigned long)(++cumulative_subr_seqn);

     /* try to work out what sub's being called in advance
      * mainly for xsubs because otherwise they're transparent
@@ -3117,8 +3117,8 @@
             logwarn("Sub %s fid %u lines %lu..%lu\n",
sub_name, fid, (unsigned long)first_line, (unsigned long)last_line);

-        NYTP_write_sub_info(out, fid, sub_name, sub_name_len, first_line,
-                            last_line);
+ NYTP_write_sub_info(out, fid, sub_name, sub_name_len, (unsigned long)first_line,
+                            (unsigned long)last_line);
     }
 }

@@ -3176,7 +3176,7 @@
                 continue;
             }
             /* trim length to effectively hide the [fid:line] suffix */
-            caller_subname_len = fid_line_start-caller_subname;
+            caller_subname_len = (I32)(fid_line_start-caller_subname);

             count = uv_from_av(aTHX_ av, NYTP_SCi_CALL_COUNT, 0);
             sc[NYTP_SCi_CALL_COUNT] = count * 1.0;
@@ -3188,13 +3188,13 @@

             NYTP_write_sub_callers(out, fid, line,
                                    caller_subname, caller_subname_len,
-                                   count,
+                                   (unsigned int)count,
                                    sc[NYTP_SCi_INCL_RTIME],
                                    sc[NYTP_SCi_EXCL_RTIME],
                                    0.0, /* NYTP_SCi_spare_3 */
                                    0.0, /* NYTP_SCi_spare_4 */
                                    sc[NYTP_SCi_RECI_RTIME],
-                                   depth,
+                                   (unsigned int)depth,
                                    called_subname, called_subname_len);

             /* sanity check - early warning */
@@ -4632,7 +4632,7 @@

         if (cb_hv) {
             SV **svp = hv_fetch(cb_hv, callback_info[i].description,
-                                callback_info[i].len, 0);
+                                (I32)(callback_info[i].len), 0);

             if (svp) {
                 if (!SvROK(*svp) && SvTYPE(SvRV(*svp)) != SVt_PVCV)

--
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]

Reply via email to