]> granicus.if.org Git - check/commitdiff
example: MSVC wants the var decl at the top
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Tue, 4 Feb 2014 00:36:04 +0000 (00:36 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Tue, 4 Feb 2014 00:36:04 +0000 (00:36 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1091 64e312b2-a51f-0410-8e61-82d0ca0eb02a

doc/example/src/money.6.c
doc/example/src/money.c

index 111e611c3b025b976a1e1f3b578d597e441bf36a..e020e9e44b7c4ef6305aec475fedd2251263f019 100644 (file)
@@ -9,12 +9,14 @@ struct Money
 
 Money *money_create(int amount, char *currency)
 {
+    Money *m;
+
     if (amount < 0)
     {
         return NULL;
     }
 
-    Money *m = malloc(sizeof(Money));
+    m = malloc(sizeof(Money));
 
     if (m == NULL)
     {
index 111e611c3b025b976a1e1f3b578d597e441bf36a..e020e9e44b7c4ef6305aec475fedd2251263f019 100644 (file)
@@ -9,12 +9,14 @@ struct Money
 
 Money *money_create(int amount, char *currency)
 {
+    Money *m;
+
     if (amount < 0)
     {
         return NULL;
     }
 
-    Money *m = malloc(sizeof(Money));
+    m = malloc(sizeof(Money));
 
     if (m == NULL)
     {