summaryrefslogtreecommitdiff
path: root/src/stable/util.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-11-05 22:41:51 +0000
committerMike Buland <eichlan@xagasoft.com>2012-11-05 22:41:51 +0000
commitec05778d5718a7912e506764d443a78d6a6179e3 (patch)
tree78a9a01532180030c095acefc45763f07c14edb8 /src/stable/util.cpp
parentb20414ac1fe80a71a90601f4cd1767fa7014a9ba (diff)
downloadlibbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.gz
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.bz2
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.xz
libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.zip
Converted tabs to spaces with tabconv.
Diffstat (limited to '')
-rw-r--r--src/stable/util.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/stable/util.cpp b/src/stable/util.cpp
index b42e040..ff9901b 100644
--- a/src/stable/util.cpp
+++ b/src/stable/util.cpp
@@ -9,57 +9,57 @@
9 9
10int Bu::getDaysInMonth( int iMonth, int iYear ) 10int Bu::getDaysInMonth( int iMonth, int iYear )
11{ 11{
12 if( iMonth > 11 ) 12 if( iMonth > 11 )
13 { 13 {
14 iYear += iMonth/12; 14 iYear += iMonth/12;
15 iMonth = iMonth%12; 15 iMonth = iMonth%12;
16 } 16 }
17 switch( iMonth ) 17 switch( iMonth )
18 { 18 {
19 case 0: 19 case 0:
20 case 2: 20 case 2:
21 case 4: 21 case 4:
22 case 6: 22 case 6:
23 case 7: 23 case 7:
24 case 9: 24 case 9:
25 case 11: 25 case 11:
26 return 31; 26 return 31;
27 break; 27 break;
28 28
29 case 3: 29 case 3:
30 case 5: 30 case 5:
31 case 8: 31 case 8:
32 case 10: 32 case 10:
33 return 30; 33 return 30;
34 break; 34 break;
35 35
36 case 1: 36 case 1:
37 if( iYear%400 == 0 ) 37 if( iYear%400 == 0 )
38 return 29; 38 return 29;
39 if( iYear%100 == 0 ) 39 if( iYear%100 == 0 )
40 return 28; 40 return 28;
41 if( iYear%4 == 0 ) 41 if( iYear%4 == 0 )
42 return 29; 42 return 29;
43 return 28; 43 return 28;
44 break; 44 break;
45 45
46 default: 46 default:
47 return -1; 47 return -1;
48 } 48 }
49} 49}
50void Bu::memcpy( void *pDest, const void *pSrc, size_t iBytes ) 50void Bu::memcpy( void *pDest, const void *pSrc, size_t iBytes )
51{ 51{
52#ifdef VALTEST 52#ifdef VALTEST
53 const char *src = (const char *)pSrc; 53 const char *src = (const char *)pSrc;
54 char *dest = (char *)pDest; 54 char *dest = (char *)pDest;
55 for( int j = 0; j < count; j++ ) 55 for( int j = 0; j < count; j++ )
56 { 56 {
57 *dest = *src; 57 *dest = *src;
58 dest++; 58 dest++;
59 src++; 59 src++;
60 } 60 }
61#else 61#else
62 ::memcpy( pDest, pSrc, iBytes ); 62 ::memcpy( pDest, pSrc, iBytes );
63#endif 63#endif
64} 64}
65 65