1919#ifdef MS_WIN32
2020#include <windows.h>
2121#include <largeint.h>
22+ #include <direct.h> /* for getcwd() */
2223typedef LARGE_INTEGER hs_time ;
2324#else
2425#ifndef HAVE_GETTIMEOFDAY
@@ -41,6 +42,14 @@ typedef struct timeval hs_time;
4142
4243#define BUFFERSIZE 10240
4344
45+ #ifndef PATH_MAX
46+ # ifdef MAX_PATH
47+ # define PATH_MAX MAX_PATH
48+ # else
49+ # error "Need a defn. for PATH_MAX in _hotshot.c"
50+ # endif
51+ #endif
52+
4453typedef struct {
4554 PyObject_HEAD
4655 PyObject * filemap ;
@@ -365,6 +374,7 @@ logreader_tp_iternext(LogReaderObject *self)
365374 goto restart ;
366375 }
367376 default :
377+ ;
368378 }
369379 if (err == ERR_EOF && oldindex != 0 ) {
370380 /* It looks like we ran out of data before we had it all; this
@@ -470,7 +480,7 @@ flush_data(ProfilerObject *self)
470480{
471481 /* Need to dump data to the log file... */
472482 size_t written = fwrite (self -> buffer , 1 , self -> index , self -> logfp );
473- if (written == self -> index )
483+ if (written == ( size_t ) self -> index )
474484 self -> index = 0 ;
475485 else {
476486 memmove (self -> buffer , & self -> buffer [written ],
@@ -723,7 +733,7 @@ tracer_callback(ProfilerObject *self, PyFrameObject *frame, int what,
723733 case PyTrace_RETURN :
724734 pack_exit (self , get_tdelta (self ));
725735 break ;
726- case PyTrace_LINE :
736+ case PyTrace_LINE :
727737 if (self -> linetimings )
728738 pack_lineno_tdelta (self , frame -> f_lineno , get_tdelta (self ));
729739 else
@@ -1259,7 +1269,7 @@ hotshot_profiler(PyObject *unused, PyObject *args)
12591269 self -> index = 0 ;
12601270 self -> active = 0 ;
12611271 self -> next_fileno = 0 ;
1262- self -> logfp = NULL ;
1272+ self -> logfp = NULL ;
12631273 self -> logfilename = PyTuple_GET_ITEM (args , 0 );
12641274 Py_INCREF (self -> logfilename );
12651275 self -> filemap = PyDict_New ();
0 commit comments