diff options
author | Stanislav Malyshev <stas@php.net> | 2015-01-03 01:22:58 -0800 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2015-01-10 15:07:38 -0800 |
commit | b7a7b1a624c97945c0aaa49d46ae996fc0bdb6bc (patch) | |
tree | 0e09490075ee4f9a75a77ef4168d8ee254c52e5b /win32 | |
parent | 773c8b0c092a0e9ad5c5548815bcb9991d54d5c1 (diff) | |
download | php-git-b7a7b1a624c97945c0aaa49d46ae996fc0bdb6bc.tar.gz |
trailing whitespace removal
Diffstat (limited to 'win32')
-rw-r--r-- | win32/build/deplister.c | 2 | ||||
-rw-r--r-- | win32/glob.h | 2 | ||||
-rw-r--r-- | win32/grp.h | 6 | ||||
-rw-r--r-- | win32/php_inttypes.h | 610 | ||||
-rw-r--r-- | win32/php_stdbool.h | 22 | ||||
-rw-r--r-- | win32/php_stdint.h | 20 | ||||
-rw-r--r-- | win32/readdir.c | 6 | ||||
-rw-r--r-- | win32/registry.c | 12 | ||||
-rw-r--r-- | win32/resource.h | 2 | ||||
-rw-r--r-- | win32/select.c | 14 | ||||
-rw-r--r-- | win32/sendmail.c | 30 | ||||
-rw-r--r-- | win32/sendmail.h | 2 | ||||
-rw-r--r-- | win32/sockets.h | 2 | ||||
-rw-r--r-- | win32/time.c | 4 | ||||
-rw-r--r-- | win32/winutil.c | 4 |
15 files changed, 369 insertions, 369 deletions
diff --git a/win32/build/deplister.c b/win32/build/deplister.c index bae6d031f6..6cbd88ccee 100644 --- a/win32/build/deplister.c +++ b/win32/build/deplister.c @@ -47,7 +47,7 @@ BOOL CALLBACK StatusRoutine(IMAGEHLP_STATUS_REASON reason, int main(int argc, char *argv[]) { return BindImageEx(BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE | BIND_ALL_IMAGES, - argv[1], NULL, argv[2], StatusRoutine); + argv[1], NULL, argv[2], StatusRoutine); } /* diff --git a/win32/glob.h b/win32/glob.h index 24ae69467c..81280ea645 100644 --- a/win32/glob.h +++ b/win32/glob.h @@ -64,7 +64,7 @@ typedef struct { * and lstat(2). */ void (*gl_closedir)(void *); - struct dirent *(*gl_readdir)(void *); + struct dirent *(*gl_readdir)(void *); void *(*gl_opendir)(const char *); int (*gl_lstat)(const char *, zend_stat_t *); int (*gl_stat)(const char *, zend_stat_t *); diff --git a/win32/grp.h b/win32/grp.h index 71454fc3b6..3bd78efca7 100644 --- a/win32/grp.h +++ b/win32/grp.h @@ -19,8 +19,8 @@ /* $Id$ */ struct group { - char *gr_name; - char *gr_passwd; - int gr_gid; + char *gr_name; + char *gr_passwd; + int gr_gid; char **gr_mem; }; diff --git a/win32/php_inttypes.h b/win32/php_inttypes.h index 25542771f5..ead903f78e 100644 --- a/win32/php_inttypes.h +++ b/win32/php_inttypes.h @@ -1,305 +1,305 @@ -// ISO C9x compliant inttypes.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
-//
-// Copyright (c) 2006 Alexander Chemeris
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. The name of the author may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef _MSC_VER // [
-#error "Use this header only with Microsoft Visual C++ compilers!"
-#endif // _MSC_VER ]
-
-#ifndef _MSC_INTTYPES_H_ // [
-#define _MSC_INTTYPES_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
-
-#include "stdint.h"
-
-// 7.8 Format conversion of integer types
-
-typedef struct {
- intmax_t quot;
- intmax_t rem;
-} imaxdiv_t;
-
-// 7.8.1 Macros for format specifiers
-
-#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
-
-// The fprintf macros for signed integers are:
-#define PRId8 "d"
-#define PRIi8 "i"
-#define PRIdLEAST8 "d"
-#define PRIiLEAST8 "i"
-#define PRIdFAST8 "d"
-#define PRIiFAST8 "i"
-
-#define PRId16 "hd"
-#define PRIi16 "hi"
-#define PRIdLEAST16 "hd"
-#define PRIiLEAST16 "hi"
-#define PRIdFAST16 "hd"
-#define PRIiFAST16 "hi"
-
-#define PRId32 "I32d"
-#define PRIi32 "I32i"
-#define PRIdLEAST32 "I32d"
-#define PRIiLEAST32 "I32i"
-#define PRIdFAST32 "I32d"
-#define PRIiFAST32 "I32i"
-
-#define PRId64 "I64d"
-#define PRIi64 "I64i"
-#define PRIdLEAST64 "I64d"
-#define PRIiLEAST64 "I64i"
-#define PRIdFAST64 "I64d"
-#define PRIiFAST64 "I64i"
-
-#define PRIdMAX "I64d"
-#define PRIiMAX "I64i"
-
-#define PRIdPTR "Id"
-#define PRIiPTR "Ii"
-
-// The fprintf macros for unsigned integers are:
-#define PRIo8 "o"
-#define PRIu8 "u"
-#define PRIx8 "x"
-#define PRIX8 "X"
-#define PRIoLEAST8 "o"
-#define PRIuLEAST8 "u"
-#define PRIxLEAST8 "x"
-#define PRIXLEAST8 "X"
-#define PRIoFAST8 "o"
-#define PRIuFAST8 "u"
-#define PRIxFAST8 "x"
-#define PRIXFAST8 "X"
-
-#define PRIo16 "ho"
-#define PRIu16 "hu"
-#define PRIx16 "hx"
-#define PRIX16 "hX"
-#define PRIoLEAST16 "ho"
-#define PRIuLEAST16 "hu"
-#define PRIxLEAST16 "hx"
-#define PRIXLEAST16 "hX"
-#define PRIoFAST16 "ho"
-#define PRIuFAST16 "hu"
-#define PRIxFAST16 "hx"
-#define PRIXFAST16 "hX"
-
-#define PRIo32 "I32o"
-#define PRIu32 "I32u"
-#define PRIx32 "I32x"
-#define PRIX32 "I32X"
-#define PRIoLEAST32 "I32o"
-#define PRIuLEAST32 "I32u"
-#define PRIxLEAST32 "I32x"
-#define PRIXLEAST32 "I32X"
-#define PRIoFAST32 "I32o"
-#define PRIuFAST32 "I32u"
-#define PRIxFAST32 "I32x"
-#define PRIXFAST32 "I32X"
-
-#define PRIo64 "I64o"
-#define PRIu64 "I64u"
-#define PRIx64 "I64x"
-#define PRIX64 "I64X"
-#define PRIoLEAST64 "I64o"
-#define PRIuLEAST64 "I64u"
-#define PRIxLEAST64 "I64x"
-#define PRIXLEAST64 "I64X"
-#define PRIoFAST64 "I64o"
-#define PRIuFAST64 "I64u"
-#define PRIxFAST64 "I64x"
-#define PRIXFAST64 "I64X"
-
-#define PRIoMAX "I64o"
-#define PRIuMAX "I64u"
-#define PRIxMAX "I64x"
-#define PRIXMAX "I64X"
-
-#define PRIoPTR "Io"
-#define PRIuPTR "Iu"
-#define PRIxPTR "Ix"
-#define PRIXPTR "IX"
-
-// The fscanf macros for signed integers are:
-#define SCNd8 "d"
-#define SCNi8 "i"
-#define SCNdLEAST8 "d"
-#define SCNiLEAST8 "i"
-#define SCNdFAST8 "d"
-#define SCNiFAST8 "i"
-
-#define SCNd16 "hd"
-#define SCNi16 "hi"
-#define SCNdLEAST16 "hd"
-#define SCNiLEAST16 "hi"
-#define SCNdFAST16 "hd"
-#define SCNiFAST16 "hi"
-
-#define SCNd32 "ld"
-#define SCNi32 "li"
-#define SCNdLEAST32 "ld"
-#define SCNiLEAST32 "li"
-#define SCNdFAST32 "ld"
-#define SCNiFAST32 "li"
-
-#define SCNd64 "I64d"
-#define SCNi64 "I64i"
-#define SCNdLEAST64 "I64d"
-#define SCNiLEAST64 "I64i"
-#define SCNdFAST64 "I64d"
-#define SCNiFAST64 "I64i"
-
-#define SCNdMAX "I64d"
-#define SCNiMAX "I64i"
-
-#ifdef _WIN64 // [
-# define SCNdPTR "I64d"
-# define SCNiPTR "I64i"
-#else // _WIN64 ][
-# define SCNdPTR "ld"
-# define SCNiPTR "li"
-#endif // _WIN64 ]
-
-// The fscanf macros for unsigned integers are:
-#define SCNo8 "o"
-#define SCNu8 "u"
-#define SCNx8 "x"
-#define SCNX8 "X"
-#define SCNoLEAST8 "o"
-#define SCNuLEAST8 "u"
-#define SCNxLEAST8 "x"
-#define SCNXLEAST8 "X"
-#define SCNoFAST8 "o"
-#define SCNuFAST8 "u"
-#define SCNxFAST8 "x"
-#define SCNXFAST8 "X"
-
-#define SCNo16 "ho"
-#define SCNu16 "hu"
-#define SCNx16 "hx"
-#define SCNX16 "hX"
-#define SCNoLEAST16 "ho"
-#define SCNuLEAST16 "hu"
-#define SCNxLEAST16 "hx"
-#define SCNXLEAST16 "hX"
-#define SCNoFAST16 "ho"
-#define SCNuFAST16 "hu"
-#define SCNxFAST16 "hx"
-#define SCNXFAST16 "hX"
-
-#define SCNo32 "lo"
-#define SCNu32 "lu"
-#define SCNx32 "lx"
-#define SCNX32 "lX"
-#define SCNoLEAST32 "lo"
-#define SCNuLEAST32 "lu"
-#define SCNxLEAST32 "lx"
-#define SCNXLEAST32 "lX"
-#define SCNoFAST32 "lo"
-#define SCNuFAST32 "lu"
-#define SCNxFAST32 "lx"
-#define SCNXFAST32 "lX"
-
-#define SCNo64 "I64o"
-#define SCNu64 "I64u"
-#define SCNx64 "I64x"
-#define SCNX64 "I64X"
-#define SCNoLEAST64 "I64o"
-#define SCNuLEAST64 "I64u"
-#define SCNxLEAST64 "I64x"
-#define SCNXLEAST64 "I64X"
-#define SCNoFAST64 "I64o"
-#define SCNuFAST64 "I64u"
-#define SCNxFAST64 "I64x"
-#define SCNXFAST64 "I64X"
-
-#define SCNoMAX "I64o"
-#define SCNuMAX "I64u"
-#define SCNxMAX "I64x"
-#define SCNXMAX "I64X"
-
-#ifdef _WIN64 // [
-# define SCNoPTR "I64o"
-# define SCNuPTR "I64u"
-# define SCNxPTR "I64x"
-# define SCNXPTR "I64X"
-#else // _WIN64 ][
-# define SCNoPTR "lo"
-# define SCNuPTR "lu"
-# define SCNxPTR "lx"
-# define SCNXPTR "lX"
-#endif // _WIN64 ]
-
-#endif // __STDC_FORMAT_MACROS ]
-
-// 7.8.2 Functions for greatest-width integer types
-
-// 7.8.2.1 The imaxabs function
-#define imaxabs _abs64
-
-// 7.8.2.2 The imaxdiv function
-
-// This is modified version of div() function from Microsoft's div.c found
-// in %MSVC.NET%\crt\src\div.c
-#ifdef STATIC_IMAXDIV // [
-static
-#else // STATIC_IMAXDIV ][
-_inline
-#endif // STATIC_IMAXDIV ]
-imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
-{
- imaxdiv_t result;
-
- result.quot = numer / denom;
- result.rem = numer % denom;
-
- if (numer < 0 && result.rem > 0) {
- // did division wrong; must fix up
- ++result.quot;
- result.rem -= denom;
- }
-
- return result;
-}
-
-// 7.8.2.3 The strtoimax and strtoumax functions
-#define strtoimax _strtoi64
-#define strtoumax _strtoui64
-
-// 7.8.2.4 The wcstoimax and wcstoumax functions
-#define wcstoimax _wcstoi64
-#define wcstoumax _wcstoui64
-
-
-#endif // _MSC_INTTYPES_H_ ]
+// ISO C9x compliant inttypes.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The name of the author may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_INTTYPES_H_ // [ +#define _MSC_INTTYPES_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include "stdint.h" + +// 7.8 Format conversion of integer types + +typedef struct { + intmax_t quot; + intmax_t rem; +} imaxdiv_t; + +// 7.8.1 Macros for format specifiers + +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 + +// The fprintf macros for signed integers are: +#define PRId8 "d" +#define PRIi8 "i" +#define PRIdLEAST8 "d" +#define PRIiLEAST8 "i" +#define PRIdFAST8 "d" +#define PRIiFAST8 "i" + +#define PRId16 "hd" +#define PRIi16 "hi" +#define PRIdLEAST16 "hd" +#define PRIiLEAST16 "hi" +#define PRIdFAST16 "hd" +#define PRIiFAST16 "hi" + +#define PRId32 "I32d" +#define PRIi32 "I32i" +#define PRIdLEAST32 "I32d" +#define PRIiLEAST32 "I32i" +#define PRIdFAST32 "I32d" +#define PRIiFAST32 "I32i" + +#define PRId64 "I64d" +#define PRIi64 "I64i" +#define PRIdLEAST64 "I64d" +#define PRIiLEAST64 "I64i" +#define PRIdFAST64 "I64d" +#define PRIiFAST64 "I64i" + +#define PRIdMAX "I64d" +#define PRIiMAX "I64i" + +#define PRIdPTR "Id" +#define PRIiPTR "Ii" + +// The fprintf macros for unsigned integers are: +#define PRIo8 "o" +#define PRIu8 "u" +#define PRIx8 "x" +#define PRIX8 "X" +#define PRIoLEAST8 "o" +#define PRIuLEAST8 "u" +#define PRIxLEAST8 "x" +#define PRIXLEAST8 "X" +#define PRIoFAST8 "o" +#define PRIuFAST8 "u" +#define PRIxFAST8 "x" +#define PRIXFAST8 "X" + +#define PRIo16 "ho" +#define PRIu16 "hu" +#define PRIx16 "hx" +#define PRIX16 "hX" +#define PRIoLEAST16 "ho" +#define PRIuLEAST16 "hu" +#define PRIxLEAST16 "hx" +#define PRIXLEAST16 "hX" +#define PRIoFAST16 "ho" +#define PRIuFAST16 "hu" +#define PRIxFAST16 "hx" +#define PRIXFAST16 "hX" + +#define PRIo32 "I32o" +#define PRIu32 "I32u" +#define PRIx32 "I32x" +#define PRIX32 "I32X" +#define PRIoLEAST32 "I32o" +#define PRIuLEAST32 "I32u" +#define PRIxLEAST32 "I32x" +#define PRIXLEAST32 "I32X" +#define PRIoFAST32 "I32o" +#define PRIuFAST32 "I32u" +#define PRIxFAST32 "I32x" +#define PRIXFAST32 "I32X" + +#define PRIo64 "I64o" +#define PRIu64 "I64u" +#define PRIx64 "I64x" +#define PRIX64 "I64X" +#define PRIoLEAST64 "I64o" +#define PRIuLEAST64 "I64u" +#define PRIxLEAST64 "I64x" +#define PRIXLEAST64 "I64X" +#define PRIoFAST64 "I64o" +#define PRIuFAST64 "I64u" +#define PRIxFAST64 "I64x" +#define PRIXFAST64 "I64X" + +#define PRIoMAX "I64o" +#define PRIuMAX "I64u" +#define PRIxMAX "I64x" +#define PRIXMAX "I64X" + +#define PRIoPTR "Io" +#define PRIuPTR "Iu" +#define PRIxPTR "Ix" +#define PRIXPTR "IX" + +// The fscanf macros for signed integers are: +#define SCNd8 "d" +#define SCNi8 "i" +#define SCNdLEAST8 "d" +#define SCNiLEAST8 "i" +#define SCNdFAST8 "d" +#define SCNiFAST8 "i" + +#define SCNd16 "hd" +#define SCNi16 "hi" +#define SCNdLEAST16 "hd" +#define SCNiLEAST16 "hi" +#define SCNdFAST16 "hd" +#define SCNiFAST16 "hi" + +#define SCNd32 "ld" +#define SCNi32 "li" +#define SCNdLEAST32 "ld" +#define SCNiLEAST32 "li" +#define SCNdFAST32 "ld" +#define SCNiFAST32 "li" + +#define SCNd64 "I64d" +#define SCNi64 "I64i" +#define SCNdLEAST64 "I64d" +#define SCNiLEAST64 "I64i" +#define SCNdFAST64 "I64d" +#define SCNiFAST64 "I64i" + +#define SCNdMAX "I64d" +#define SCNiMAX "I64i" + +#ifdef _WIN64 // [ +# define SCNdPTR "I64d" +# define SCNiPTR "I64i" +#else // _WIN64 ][ +# define SCNdPTR "ld" +# define SCNiPTR "li" +#endif // _WIN64 ] + +// The fscanf macros for unsigned integers are: +#define SCNo8 "o" +#define SCNu8 "u" +#define SCNx8 "x" +#define SCNX8 "X" +#define SCNoLEAST8 "o" +#define SCNuLEAST8 "u" +#define SCNxLEAST8 "x" +#define SCNXLEAST8 "X" +#define SCNoFAST8 "o" +#define SCNuFAST8 "u" +#define SCNxFAST8 "x" +#define SCNXFAST8 "X" + +#define SCNo16 "ho" +#define SCNu16 "hu" +#define SCNx16 "hx" +#define SCNX16 "hX" +#define SCNoLEAST16 "ho" +#define SCNuLEAST16 "hu" +#define SCNxLEAST16 "hx" +#define SCNXLEAST16 "hX" +#define SCNoFAST16 "ho" +#define SCNuFAST16 "hu" +#define SCNxFAST16 "hx" +#define SCNXFAST16 "hX" + +#define SCNo32 "lo" +#define SCNu32 "lu" +#define SCNx32 "lx" +#define SCNX32 "lX" +#define SCNoLEAST32 "lo" +#define SCNuLEAST32 "lu" +#define SCNxLEAST32 "lx" +#define SCNXLEAST32 "lX" +#define SCNoFAST32 "lo" +#define SCNuFAST32 "lu" +#define SCNxFAST32 "lx" +#define SCNXFAST32 "lX" + +#define SCNo64 "I64o" +#define SCNu64 "I64u" +#define SCNx64 "I64x" +#define SCNX64 "I64X" +#define SCNoLEAST64 "I64o" +#define SCNuLEAST64 "I64u" +#define SCNxLEAST64 "I64x" +#define SCNXLEAST64 "I64X" +#define SCNoFAST64 "I64o" +#define SCNuFAST64 "I64u" +#define SCNxFAST64 "I64x" +#define SCNXFAST64 "I64X" + +#define SCNoMAX "I64o" +#define SCNuMAX "I64u" +#define SCNxMAX "I64x" +#define SCNXMAX "I64X" + +#ifdef _WIN64 // [ +# define SCNoPTR "I64o" +# define SCNuPTR "I64u" +# define SCNxPTR "I64x" +# define SCNXPTR "I64X" +#else // _WIN64 ][ +# define SCNoPTR "lo" +# define SCNuPTR "lu" +# define SCNxPTR "lx" +# define SCNXPTR "lX" +#endif // _WIN64 ] + +#endif // __STDC_FORMAT_MACROS ] + +// 7.8.2 Functions for greatest-width integer types + +// 7.8.2.1 The imaxabs function +#define imaxabs _abs64 + +// 7.8.2.2 The imaxdiv function + +// This is modified version of div() function from Microsoft's div.c found +// in %MSVC.NET%\crt\src\div.c +#ifdef STATIC_IMAXDIV // [ +static +#else // STATIC_IMAXDIV ][ +_inline +#endif // STATIC_IMAXDIV ] +imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) +{ + imaxdiv_t result; + + result.quot = numer / denom; + result.rem = numer % denom; + + if (numer < 0 && result.rem > 0) { + // did division wrong; must fix up + ++result.quot; + result.rem -= denom; + } + + return result; +} + +// 7.8.2.3 The strtoimax and strtoumax functions +#define strtoimax _strtoi64 +#define strtoumax _strtoui64 + +// 7.8.2.4 The wcstoimax and wcstoumax functions +#define wcstoimax _wcstoi64 +#define wcstoumax _wcstoui64 + + +#endif // _MSC_INTTYPES_H_ ] diff --git a/win32/php_stdbool.h b/win32/php_stdbool.h index 83c808f60e..cc853c59c1 100644 --- a/win32/php_stdbool.h +++ b/win32/php_stdbool.h @@ -1,11 +1,11 @@ -#ifndef _STDBOOL_H
-#define _STDBOOL_H
-#if !defined(__BOOL_DEFINED)
-# define bool short
-
-/* The other macros must be usable in preprocessor directives. */
-# define false 0
-# define true 1
-# define __bool_true_false_are_defined 1
-# endif
-#endif /* _STDBOOL_H */
+#ifndef _STDBOOL_H +#define _STDBOOL_H +#if !defined(__BOOL_DEFINED) +# define bool short + +/* The other macros must be usable in preprocessor directives. */ +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +# endif +#endif /* _STDBOOL_H */ diff --git a/win32/php_stdint.h b/win32/php_stdint.h index e5e0efbb1d..e7615f1479 100644 --- a/win32/php_stdint.h +++ b/win32/php_stdint.h @@ -1,32 +1,32 @@ // ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// // Copyright (c) 2006-2009 Alexander Chemeris -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: -// +// // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. -// +// // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // 3. The name of the author may be used to endorse or promote products // derived from this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// +// /////////////////////////////////////////////////////////////////////////////// #ifndef _MSC_VER // [ @@ -55,7 +55,7 @@ // error C2733: second C linkage of overloaded function 'wmemchr' not allowed #if (_MSC_VER < 1300) && defined(__cplusplus) extern "C++" { -#endif +#endif # include <wchar.h> #if (_MSC_VER < 1300) && defined(__cplusplus) } diff --git a/win32/readdir.c b/win32/readdir.c index 15e145bafa..b94b570cf4 100644 --- a/win32/readdir.c +++ b/win32/readdir.c @@ -37,7 +37,7 @@ DIR *opendir(const char *dir) } strcpy(filespec, resolved_path_buff); index = (int)strlen(filespec) - 1; - if (index >= 0 && (filespec[index] == '/' || + if (index >= 0 && (filespec[index] == '/' || (filespec[index] == '\\' && (index == 0 || !IsDBCSLeadByte(filespec[index-1]))))) filespec[index] = '\0'; strcat(filespec, "\\*"); @@ -152,7 +152,7 @@ int rewinddir(DIR *dp) strcpy(filespec, dp->dir); index = (int)strlen(filespec) - 1; - if (index >= 0 && (filespec[index] == '/' || + if (index >= 0 && (filespec[index] == '/' || (filespec[index] == '\\' && (index == 0 || !IsDBCSLeadByte(filespec[index-1]))))) filespec[index] = '\0'; strcat(filespec, "/*"); @@ -160,7 +160,7 @@ int rewinddir(DIR *dp) if ((handle = FindFirstFile(filespec, &(dp->fileinfo))) == INVALID_HANDLE_VALUE) { dp->finished = 1; } - + dp->handle = handle; free(filespec); diff --git a/win32/registry.c b/win32/registry.c index da21c7d942..272246420b 100644 --- a/win32/registry.c +++ b/win32/registry.c @@ -37,10 +37,10 @@ static int OpenPhpRegistryKey(char* sub_key, HKEY *hKey) main_key_len = strlen(*key_name); reg_key = emalloc(main_key_len + sub_key_len + 1); memcpy(reg_key, *key_name, main_key_len); - memcpy(reg_key + main_key_len, sub_key, sub_key_len + 1); + memcpy(reg_key + main_key_len, sub_key, sub_key_len + 1); ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_key, 0, KEY_READ, hKey); efree(reg_key); - + if (ret == ERROR_SUCCESS) { return 1; } @@ -64,7 +64,7 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_ HashTable *ht = NULL; if (RegQueryInfoKey(key, NULL, NULL, NULL, &keys, &max_key, NULL, &values, &max_name, &max_value, NULL, NULL) == ERROR_SUCCESS) { - + if (values) { DWORD i; char *name = (char*)emalloc(max_name+1); @@ -96,7 +96,7 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_ ZEND_HASH_FOREACH_KEY_VAL(parent_ht, num, index, tmpdata) { zend_hash_add(ht, index, tmpdata); - } ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FOREACH_END(); } zend_hash_str_update_mem(directories, path, path_len + 1, &ht, sizeof(HashTable*)); ret = 1; @@ -244,7 +244,7 @@ void UpdateIniFromRegistry(char *path) ZEND_HASH_FOREACH_KEY_VAL(ht, num, index, data) { zend_alter_ini_entry(index, Z_STR_P(data), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - } ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FOREACH_END(); /* for (zend_hash_internal_pointer_reset_ex(ht, &pos); zend_hash_get_current_data_ex(ht, (void**)&data, &pos) == SUCCESS && @@ -273,7 +273,7 @@ char *GetIniPathFromRegistry() { char *reg_location = NULL; HKEY hKey; - + if (OpenPhpRegistryKey(NULL, &hKey)) { DWORD buflen = MAXPATHLEN; reg_location = emalloc(MAXPATHLEN+1); diff --git a/win32/resource.h b/win32/resource.h index 13760d4962..a7a11de7e4 100644 --- a/win32/resource.h +++ b/win32/resource.h @@ -4,7 +4,7 @@ // // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 diff --git a/win32/select.c b/win32/select.c index 636c84364a..9c040a6d23 100644 --- a/win32/select.c +++ b/win32/select.c @@ -47,7 +47,7 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru int retcode; #define SAFE_FD_ISSET(fd, set) (set != NULL && FD_ISSET(fd, set)) - + /* calculate how long we need to wait in milliseconds */ if (tv == NULL) { ms_total = INFINITE; @@ -59,7 +59,7 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru FD_ZERO(&sock_read); FD_ZERO(&sock_write); FD_ZERO(&sock_except); - + /* build an array of handles for non-sockets */ for (i = 0; i < max_fd; i++) { if (SAFE_FD_ISSET(i, rfds) || SAFE_FD_ISSET(i, wfds) || SAFE_FD_ISSET(i, efds)) { @@ -89,18 +89,18 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru /* plain sockets only - let winsock handle the whole thing */ return select(max_fd, rfds, wfds, efds, tv); } - + /* mixture of handles and sockets; lets multiplex between * winsock and waiting on the handles */ FD_ZERO(&aread); FD_ZERO(&awrite); FD_ZERO(&aexcept); - + limit = GetTickCount64() + ms_total; do { retcode = 0; - + if (sock_max_fd >= 0) { /* overwrite the zero'd sets here; the select call * will clear those that are not active */ @@ -159,8 +159,8 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru } if (efds) { *efds = aexcept; - } - + } + return retcode; } diff --git a/win32/sendmail.c b/win32/sendmail.c index db31d7d0e4..d97231c9d6 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -1,8 +1,8 @@ -/* +/* * PHP Sendmail for Windows. * * This file is rewriten specificly for PHPFI. Some functionality - * has been removed (MIME and file attachments). This code was + * has been removed (MIME and file attachments). This code was * modified from code based on code written by Jarle Aase. * * This class is based on the original code by Jarle Aase, see bellow: @@ -155,7 +155,7 @@ static zend_string *php_win32_mail_trim_header(char *header) { #if HAVE_PCRE || HAVE_BUNDLED_PCRE - + zend_string *result, *result2; zval replace; zend_string *regex; @@ -255,7 +255,7 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message, headers_lc->val[i] = tolower(headers_lc->val[i]); } } - + /* Fall back to sendmail_from php.ini setting */ if (mailRPath && *mailRPath) { RPath = estrdup(mailRPath); @@ -266,7 +266,7 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message, ((pos1 == headers_lc->val) || (*(pos1-1) == '\n')) ) { /* Real offset is memaddress from the original headers + difference of - * string found in the lowercase headrs + 5 characters to jump over + * string found in the lowercase headrs + 5 characters to jump over * the from: */ pos1 = headers + (pos1 - headers_lc->val) + 5; if (NULL == (pos2 = strstr(pos1, "\r\n"))) { @@ -331,12 +331,12 @@ PHPAPI void TSMClose() { Post("QUIT\r\n"); Ack(NULL); - /* to guarantee that the cleanup is not made twice and + /* to guarantee that the cleanup is not made twice and compomise the rest of the application if sockets are used - elesewhere + elesewhere */ - shutdown(sc, 0); + shutdown(sc, 0); closesocket(sc); } @@ -362,7 +362,7 @@ PHPAPI char *GetSMErrorText(int index) PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle, size_t needle_len, char *str, size_t str_len); - + /********************************************************************* // Name: SendText @@ -382,7 +382,7 @@ PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle, // Author/Date: jcar 20/9/96 // History: //*******************************************************************/ -static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, +static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, char *headers, char *headers_lc, char **error_message) { int res; @@ -896,7 +896,7 @@ again: /* Check for newline */ Index += rlen; - + /* SMPT RFC says \r\n is the only valid line ending, who are we to argue ;) * The response code must contain at least 5 characters ex. 220\r\n */ if (Received < 5 || buf[Received - 1] != '\n' || buf[Received - 2] != '\r') { @@ -966,14 +966,14 @@ static unsigned long GetAddr(LPSTR szHost) /********************************************************************* // Name: int FormatEmailAddress -// Input: +// Input: // Output: // Description: Formats the email address to remove any content ouside // of the angle brackets < > as per RFC 2821. // -// Returns the invalidly formatted mail address if the < > are +// Returns the invalidly formatted mail address if the < > are // unbalanced (the SMTP server should reject it if it's out of spec.) -// +// // Author/Date: garretts 08/18/2009 // History: //********************************************************************/ @@ -986,6 +986,6 @@ static int FormatEmailAddress(char* Buf, char* EmailAddress, char* FormatString) result = snprintf(Buf, MAIL_BUFFER_SIZE, FormatString , tmpAddress1+1); *tmpAddress2 = '>'; // put it back the way it was. return result; - } + } return snprintf(Buf, MAIL_BUFFER_SIZE , FormatString , EmailAddress ); } /* end FormatEmailAddress() */ diff --git a/win32/sendmail.h b/win32/sendmail.h index 77d909ab1f..855792df73 100644 --- a/win32/sendmail.h +++ b/win32/sendmail.h @@ -38,7 +38,7 @@ PHPAPI int TSendMail(char *smtpaddr, int *returnerror, char **error_message, char *RPath, char *Subject, char *mailTo, char *data, char *mailCc, char *mailBcc, char *mailRPath); PHPAPI void TSMClose(void); -static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, +static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, char *headers, char *headers_lc, char **error_message); PHPAPI char *GetSMErrorText(int index); diff --git a/win32/sockets.h b/win32/sockets.h index c5cd4d19ed..edbad5b66e 100644 --- a/win32/sockets.h +++ b/win32/sockets.h @@ -23,4 +23,4 @@ /* Code originally from ext/sockets */ -PHPAPI int socketpair(int domain, int type, int protocol, SOCKET sock[2]);
\ No newline at end of file +PHPAPI int socketpair(int domain, int type, int protocol, SOCKET sock[2]); diff --git a/win32/time.c b/win32/time.c index 9b5030a0f2..b65a92c771 100644 --- a/win32/time.c +++ b/win32/time.c @@ -5,7 +5,7 @@ * Freely redistributable and modifiable. Use at your own risk. * * * * Copyright 1994 The Downhill Project * - * + * * Modified by Shane Caraveo for use with PHP * *****************************************************************************/ @@ -59,7 +59,7 @@ static zend_always_inline int getfilesystemtime(struct timeval *tv) timefunc(&ft); /* - * Do not cast a pointer to a FILETIME structure to either a + * Do not cast a pointer to a FILETIME structure to either a * ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows. * via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx */ diff --git a/win32/winutil.c b/win32/winutil.c index f13a785212..ecd2e9eac1 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -88,8 +88,8 @@ PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size) { /* {{{ if (has_crypto_ctx == 0) { /* CRYPT_VERIFYCONTEXT > only hashing&co-like use, no need to acces prv keys */ if (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET|CRYPT_VERIFYCONTEXT )) { - /* Could mean that the key container does not exist, let try - again by asking for a new one. If it fails here, it surely means that the user running + /* Could mean that the key container does not exist, let try + again by asking for a new one. If it fails here, it surely means that the user running this process does not have the permission(s) to use this container. */ if (GetLastError() == NTE_BAD_KEYSET) { |