~ubuntu-branches/ubuntu/lucid/graphviz/lucid-security

« back to all changes in this revision

Viewing changes to tools/expr/exzero.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephen M Moraco
  • Date: 2002-02-05 18:52:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020205185212-8i04c70te00rc40y
Tags: upstream-1.7.16
ImportĀ upstreamĀ versionĀ 1.7.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#pragma prototyped
 
2
/*
 
3
 * Glenn Fowler
 
4
 * AT&T Research
 
5
 *
 
6
 * expression library support
 
7
 */
 
8
 
 
9
#include "exlib.h"
 
10
 
 
11
/*
 
12
 * return 0 value for type
 
13
 */
 
14
 
 
15
Extype_t
 
16
exzero(int type)
 
17
{
 
18
        Extype_t        v;
 
19
 
 
20
        switch (type)
 
21
        {
 
22
        case FLOATING:
 
23
                v.floating = 0.0;
 
24
                break;
 
25
        case INTEGER:
 
26
        case UNSIGNED:
 
27
                v.integer = 0;
 
28
                break;
 
29
        case STRING:
 
30
                v.string = "";
 
31
                break;
 
32
        default:
 
33
                v.user = 0;
 
34
                break;
 
35
        }
 
36
        return v;
 
37
}