Debian Codegraph @

lib/expr/exzero.c

raw
1 /*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11 /*
12 * Glenn Fowler
13 * AT&T Research
14 *
15 * expression library support
16 */
17
18 #include "config.h"
19
20 #include <expr/exlib.h>
21
22 /*
23 * return 0 value for type
24 */
25
26 Extype_t exzero(long int type) {
27 Extype_t v = {0};
28
29 switch (type)
30 {
31 case FLOATING:
32 v.floating = 0.0;
33 break;
34 case INTEGER:
35 case UNSIGNED:
36 v.integer = 0;
37 break;
38 case STRING:
39 v.string = expr.nullstring;
40 break;
41 }
42 return v;
43 }