Skip to content

Commit a0407f5

Browse files
committed
Add comment about void* use in MemSet.
1 parent 0e5c62d commit a0407f5

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/include/c.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $PostgreSQL: pgsql/src/include/c.h,v 1.188 2005/07/18 15:53:28 tgl Exp $
15+
* $PostgreSQL: pgsql/src/include/c.h,v 1.189 2005/07/21 15:16:27 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -630,6 +630,7 @@ typedef NameData *Name;
630630
#define MemSet(start, val, len) \
631631
do \
632632
{ \
633+
/* must be void* because we don't know if it is integer aligned yet */ \
633634
void *_vstart = (void *) (start); \
634635
int _val = (val); \
635636
Size _len = (len); \

src/include/utils/timestamp.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.49 2005/07/21 04:48:42 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.50 2005/07/21 15:16:27 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -63,6 +63,12 @@ typedef struct
6363
/* in both timestamp.h and ecpg/dt.h */
6464
#define DAYS_PER_YEAR 365.25 /* assumes leap year every four years */
6565
#define MONTHS_PER_YEAR 12
66+
/*
67+
* DAYS_PER_MONTH is very imprecise. The more accurate value is
68+
* 365.25/12 = 30.4375, or '30 days 10:30:00'. Right now we only
69+
* return an integral number of days, but someday perhaps we should
70+
* also return a 'time' value to be used as well.
71+
*/
6672
#define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */
6773
#define HOURS_PER_DAY 24 /* assume no daylight savings time changes */
6874

src/interfaces/ecpg/pgtypeslib/dt.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ do { \
219219
/* in both timestamp.h and ecpg/dt.h */
220220
#define DAYS_PER_YEAR 365.25 /* assumes leap year every four years */
221221
#define MONTHS_PER_YEAR 12
222+
/*
223+
* DAYS_PER_MONTH is very imprecise. The more accurate value is
224+
* 365.25/12 = 30.4375, or '30 days 10:30:00'. Right now we only
225+
* return an integral number of days, but someday perhaps we should
226+
* also return a 'time' value to be used as well.
227+
*/
222228
#define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */
223229
#define HOURS_PER_DAY 24 /* assume no daylight savings time changes */
224230

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy