comparison Python/pythonrun.c @ 5415:596380a567d2 legacy-trunk

Keep MS compiler happy: use (int)strlen() when comparing; make sure not to use kill().
author Guido van Rossum <guido@python.org>
date Tue, 06 May 1997 15:24:59 +0000
parents b7871ca930ad
children e926c331ebbf
comparison
equal deleted inserted replaced
5414:013ff6951909 5415:596380a567d2
53 53
54 #ifdef MS_WIN32 54 #ifdef MS_WIN32
55 #undef BYTE 55 #undef BYTE
56 #undef arglist 56 #undef arglist
57 #include "windows.h" 57 #include "windows.h"
58 #endif
59
60 #ifdef HAVE_GETPID
61 #ifndef MS_WINDOWS
62 #define HAVE_KILL
63 #endif
58 #endif 64 #endif
59 65
60 extern char *Py_GetPath(); 66 extern char *Py_GetPath();
61 67
62 extern grammar _PyParser_Grammar; /* From graminit.c */ 68 extern grammar _PyParser_Grammar; /* From graminit.c */
368 PyFile_WriteString(buf, f); 374 PyFile_WriteString(buf, f);
369 PyFile_WriteString("\n", f); 375 PyFile_WriteString("\n", f);
370 if (text != NULL) { 376 if (text != NULL) {
371 char *nl; 377 char *nl;
372 if (offset > 0 && 378 if (offset > 0 &&
373 offset == strlen(text)) 379 offset == (int)strlen(text))
374 offset--; 380 offset--;
375 for (;;) { 381 for (;;) {
376 nl = strchr(text, '\n'); 382 nl = strchr(text, '\n');
377 if (nl == NULL || 383 if (nl == NULL ||
378 nl-text >= offset) 384 nl-text >= offset)
726 sighandler(sig) 732 sighandler(sig)
727 int sig; 733 int sig;
728 { 734 {
729 signal(sig, SIG_DFL); /* Don't catch recursive signals */ 735 signal(sig, SIG_DFL); /* Don't catch recursive signals */
730 Py_Cleanup(); /* Do essential clean-up */ 736 Py_Cleanup(); /* Do essential clean-up */
731 #ifdef HAVE_GETPID 737 #ifdef HAVE_KILL
732 kill(getpid(), sig); /* Pretend the signal killed us */ 738 kill(getpid(), sig); /* Pretend the signal killed us */
733 #else 739 #else
734 exit(1); 740 exit(1);
735 #endif 741 #endif
736 /*NOTREACHED*/ 742 /*NOTREACHED*/