~ubuntu-branches/ubuntu/vivid/bc/vivid-proposed

« back to all changes in this revision

Viewing changes to bc/load.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-05 12:24:03 UTC
  • mfrom: (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20071205122403-rv1a7x90ktu1wl95
Tags: 1.06.94-3ubuntu1
* Merge with Debian; remaining changes:
  - Make bc/dc notice read and write errors on its input and output.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* load.c:  This code "loads" code into the code segments. */
2
 
 
3
1
/*  This file is part of GNU bc.
4
 
    Copyright (C) 1991-1994, 1997, 2000 Free Software Foundation, Inc.
 
2
 
 
3
    Copyright (C) 1991-1994, 1997, 2006 Free Software Foundation, Inc.
5
4
 
6
5
    This program is free software; you can redistribute it and/or modify
7
6
    it under the terms of the GNU General Public License as published by
14
13
    GNU General Public License for more details.
15
14
 
16
15
    You should have received a copy of the GNU General Public License
17
 
    along with this program; see the file COPYING.  If not, write to
 
16
    along with this program; see the file COPYING.  If not, write to:
18
17
      The Free Software Foundation, Inc.
19
 
      59 Temple Place, Suite 330
20
 
      Boston, MA 02111 USA
 
18
      Foundation, Inc.  51 Franklin Street, Fifth Floor,
 
19
      Boston, MA 02110-1301  USA
21
20
 
22
21
    You may contact the author by:
23
22
       e-mail:  philnelson@acm.org
28
27
       
29
28
*************************************************************************/
30
29
 
 
30
/* load.c:  This code "loads" code into the code segments. */
 
31
 
31
32
#include "bcdefs.h"
32
 
#include "global.h"
33
33
#include "proto.h"
34
34
 
35
35
/* Load variables. */
52
52
/* addbyte adds one BYTE to the current code segment. */
53
53
void
54
54
addbyte (byte)
55
 
     char byte;
 
55
     int byte;
56
56
{
57
57
  int pc;
58
58
  bc_function *f;
75
75
    }
76
76
 
77
77
  /* Store the byte. */
78
 
  f->f_body[pc] = byte;
 
78
  f->f_body[pc] = (char) (byte & 0xff);
79
79
  f->f_code_size++;
80
80
}
81
81