~ubuntu-branches/ubuntu/raring/sunpinyin/raring

« back to all changes in this revision

Viewing changes to src/slm/tslmendian/writer.cpp

  • Committer: Package Import Robot
  • Author(s): YunQiang Su
  • Date: 2012-03-30 15:31:55 UTC
  • mfrom: (1.1.3) (1.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20120330153155-qgls77sogzgtg9zp
Tags: 2.0.3+git20120222-1
* Team upload: git snapshot 20120222.
   - fix breaks if LDFLAGS in environment contains
       multiple words (Closese #646001).
   - rm patches merged to upstream:
       append-os-environ-toenv.patch
       fix-ftbfs-on-sh.patch
       remove-10-candidate-words-limitation.patch
   - refresh disable-lm-dict-compile.patch.
* Bump stardard version to 3.9.3: no modify needed.
* add libsunpinyin3-dbg and python-sunpinyin packages.
* debian/compat to 9, multiarch it.
* rewrite debian/rules with dh 7 format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
#include "writer.h"
6
6
 
7
 
int get_host_endian() {
 
7
int
 
8
get_host_endian()
 
9
{
8
10
    return htons(0x0001) == 0x0100 ? LITTLE_ENDIAN : BIG_ENDIAN;
9
11
}
10
12
 
11
 
int parse_endian(const char* arg)
 
13
int
 
14
parse_endian(const char* arg)
12
15
{
13
16
    if (!strcmp(arg, "le")) {
14
17
        return LITTLE_ENDIAN;
19
22
    }
20
23
}
21
24
 
22
 
const char* endian2str(int endian)
 
25
const char*
 
26
endian2str(int endian)
23
27
{
24
28
    static const char le[] = "little-endian";
25
29
    static const char be[] = "big-endian";
26
 
    
 
30
 
27
31
    switch (endian) {
28
32
    case LITTLE_ENDIAN:
29
33
        return le;