~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* 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 1992 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: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/bitter.c,v 1.1 1992/10/28 00:28:39 jutta Exp $*/
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
 
 
15
 
void write_code P2((s_spex, n_spex), struct spex * s_spex, int n_spex)
16
 
{
17
 
        struct spex     * sp = s_spex;
18
 
        int             bits = 8;
19
 
        int             vars;
20
 
 
21
 
        if (!n_spex) return;
22
 
 
23
 
        vars = sp->varsize;
24
 
 
25
 
        while (n_spex) {
26
 
 
27
 
                if (bits == 8) printf("\t*c++ =   ");
28
 
                else printf("\t       | ");
29
 
 
30
 
                if (vars == bits) {
31
 
 
32
 
                        printf( (bits==8? "%s & 0x%lX;\n" : "(%s & 0x%lX);\n"),
33
 
                                sp->var,
34
 
                                ~(0xfffffffe << (bits - 1)));
35
 
                        if (!-- n_spex) break;
36
 
                        sp++;
37
 
 
38
 
                        vars = sp->varsize;
39
 
                        bits = 8;
40
 
 
41
 
                } else if (vars < bits) {
42
 
 
43
 
                        printf( "((%s & 0x%lX) << %d)",
44
 
                                sp->var,
45
 
                                ~(0xfffffffe << (vars - 1)),
46
 
                                bits - vars);
47
 
                        bits -= vars;
48
 
                        if (!--n_spex) {
49
 
                                puts(";");
50
 
                                break;
51
 
                        }
52
 
                        else putchar('\n');
53
 
                        sp++;
54
 
                        vars = sp->varsize;
55
 
 
56
 
                } else {
57
 
                        printf("((%s >> %d) & 0x%X);\n",
58
 
                                sp->var,
59
 
                                vars - bits,
60
 
                                ~(0xfffffffe << (bits - 1)));
61
 
 
62
 
                        vars -= bits;
63
 
                        bits = 8;
64
 
                }
65
 
        }
66
 
}