~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to vector/v.convert/type.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <grass/Vect.h>
2
 
#include <grass/glocale.h>
3
 
#include "conv.h"
4
 
 
5
 
/* conversion of old file format elment type codes to new 
6
 
 *
7
 
 *  returns: new type
8
 
 *           0 - dead element
9
 
 *          -1 - error
10
 
 */
11
 
char dig_old_to_new_type(char type)
12
 
{
13
 
    switch (type) {
14
 
    case FILE_LINE:
15
 
        type = GV_LINE;
16
 
        break;
17
 
    case FILE_AREA:
18
 
        type = GV_BOUNDARY;
19
 
        break;
20
 
    case FILE_DOT:
21
 
        type = GV_POINT;
22
 
        break;
23
 
    case FILE_DEAD_LINE:
24
 
    case FILE_DEAD_AREA:
25
 
    case FILE_DEAD_DOT:
26
 
        type = 0;
27
 
        break;
28
 
    default:
29
 
        G_warning(_("OLD_T_NEW Got a bad type code [%x]"), type);
30
 
        type = -1;
31
 
        break;
32
 
    }
33
 
    return (type);
34
 
}
35
 
 
36
 
/* conversion of new element types to old file format elment type codes */
37
 
char dig_new_to_old_type(char type)
38
 
{
39
 
    switch (type) {
40
 
    case GV_LINE:
41
 
        type = FILE_LINE;
42
 
        break;
43
 
    case GV_BOUNDARY:
44
 
        type = FILE_AREA;
45
 
        break;
46
 
    case GV_POINT:
47
 
        type = FILE_DOT;
48
 
        break;
49
 
    default:
50
 
        G_warning(_("NEW_T_OLD Got a bad type code [%x]"), type);
51
 
        type = 0;
52
 
        break;
53
 
    }
54
 
    return (type);
55
 
}