~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.0.1/third_party/gsm/tls/ginger.c

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 1996 by Jutta Degener and Carsten Bormann, Technische
3
 
 * Universitaet Berlin.  See the accompanying file "COPYRIGHT" for
4
 
 * details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
5
 
 */
6
 
 
7
 
/*$Header*/
8
 
 
9
 
/* Generate code to pack a bit array from a name:#bits description */
10
 
 
11
 
#include        <stdio.h>
12
 
#include        "taste.h"
13
 
#include        "proto.h"
14
 
#include        <limits.h>
15
 
 
16
 
/* This module is the opposite of sour.   Sweet was already taken,
17
 
 * that's why it's called ginger.  (Add one point if that reminds
18
 
 * you of Gary Larson.)
19
 
 */
20
 
 
21
 
#define WORD_BITS       16      /* sizeof(uword) * CHAR_BIT on the
22
 
                                 * target architecture---if this isn't 16,
23
 
                                 * you're in trouble with this library anyway.
24
 
                                 */
25
 
 
26
 
#define BYTE_BITS        8      /* CHAR_BIT on the target architecture---
27
 
                                 * if this isn't 8, you're in *deep* trouble.
28
 
                                 */
29
 
 
30
 
void write_code P2((s_spex, n_spex), struct spex * s_spex, int n_spex)
31
 
{
32
 
        struct spex     * sp = s_spex;
33
 
        int               n_in = 0;
34
 
 
35
 
        printf("uword sr = 0;\n");
36
 
 
37
 
        for (; n_spex > 0; n_spex--, sp++) {
38
 
 
39
 
                while (n_in < sp->varsize) {
40
 
                        if (n_in) printf("sr |= (uword)*c++ << %d;\n", n_in);
41
 
                        else printf("sr = *c++;\n");
42
 
                        n_in += BYTE_BITS;
43
 
                }
44
 
 
45
 
                printf("%s = sr & %#x;  sr >>= %d;\n",
46
 
                        sp->var, ~(~0U << sp->varsize), sp->varsize);
47
 
 
48
 
                n_in -= sp->varsize;
49
 
        }
50
 
 
51
 
        if (n_in > 0) {
52
 
                fprintf(stderr, "%d bits left over\n", n_in);
53
 
        }
54
 
}