~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to dbug/factorial.c

  • Committer: Brian Aker
  • Date: 2008-07-18 20:10:26 UTC
  • mfrom: (51.3.29 remove-dbug)
  • Revision ID: brian@tangent.org-20080718201026-tto5golt0xhwqe4a
Merging in Jay's final patch on dbug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifdef DBUG_OFF                         /* We are testing dbug */
2
 
 
3
 
int factorial(register int value) {
4
 
        if(value > 1) {
5
 
                value *= factorial(value-1);
6
 
        }
7
 
        return value;
8
 
}
9
 
 
10
 
#else
11
 
 
12
 
#include <my_global.h>
13
 
 
14
 
int factorial (
15
 
register int value)
16
 
{
17
 
    DBUG_ENTER ("factorial");
18
 
    DBUG_PRINT ("find", ("find %d factorial", value));
19
 
    if (value > 1) {
20
 
        value *= factorial (value - 1);
21
 
    }
22
 
    DBUG_PRINT ("result", ("result is %d", value));
23
 
    DBUG_RETURN (value);
24
 
}
25
 
 
26
 
#endif
27