~ubuntu-branches/ubuntu/lucid/erlang/lucid-proposed

« back to all changes in this revision

Viewing changes to lib/erl_interface/src/legacy/erl_marshal.c

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-06-11 12:18:07 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090611121807-ks7eb4xrt7dsysgx
Tags: 1:13.b.1-dfsg-1
* New upstream release.
* Removed unnecessary dependency of erlang-os-mon on erlang-observer and
  erlang-tools and added missing dependency of erlang-nox on erlang-os-mon
  (closes: #529512).
* Removed a patch to eunit application because the bug was fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1630
1630
    erlang_big *b1,*b2;
1631
1631
 
1632
1632
    i1 = i2 = 0;
1633
 
    if ( ei_decode_long(*e1,&i1,&l1) < 0 ) return -1;
 
1633
    if ( ei_decode_long((char *)*e1,&i1,&l1) < 0 ) return -1;
1634
1634
    
1635
 
    ei_get_type(*e2,&i2,&t2,&n2);
 
1635
    ei_get_type((char *)*e2,&i2,&t2,&n2);
1636
1636
    
1637
1637
    /* any small will fit in two digits */
1638
1638
    if ( (b1 = ei_alloc_big(2)) == NULL ) return -1;
1646
1646
        return 1;
1647
1647
    }
1648
1648
 
1649
 
    if ( ei_decode_big(*e2,&i2,b2) < 0 ) {
 
1649
    if ( ei_decode_big((char *)*e2,&i2,b2) < 0 ) {
1650
1650
        ei_free_big(b1);
1651
1651
        ei_free_big(b2);
1652
1652
        return 1;
1672
1672
    /* small -> float -> float_comp */
1673
1673
 
1674
1674
    i1 = i2 = 0;
1675
 
    if ( ei_decode_long(*e1,&i1,&l1) < 0 ) return -1;
1676
 
    if ( ei_decode_double(*e2,&i2,&f2) < 0 ) return 1;
 
1675
    if ( ei_decode_long((char *)*e1,&i1,&l1) < 0 ) return -1;
 
1676
    if ( ei_decode_double((char *)*e2,&i2,&f2) < 0 ) return 1;
1677
1677
    
1678
1678
    f1 = to_float(l1);
1679
1679
 
1694
1694
    /* big -> float if overflow return big sign else float_comp */
1695
1695
    
1696
1696
    i1 = i2 = 0;
1697
 
    if ( ei_decode_double(*e1,&i1,&f1) < 0 ) return -1;
 
1697
    if ( ei_decode_double((char *)*e1,&i1,&f1) < 0 ) return -1;
1698
1698
    
1699
 
    if (ei_get_type(*e2,&i2,&t2,&n2) < 0) return 1;
 
1699
    if (ei_get_type((char *)*e2,&i2,&t2,&n2) < 0) return 1;
1700
1700
    if ((b2 = ei_alloc_big(n2)) == NULL) return 1;
1701
 
    if (ei_decode_big(*e2,&i2,b2) < 0) return 1;
 
1701
    if (ei_decode_big((char *)*e2,&i2,b2) < 0) return 1;
1702
1702
    
1703
1703
    /* convert the big to float */
1704
1704
    if ( ei_big_to_double(b2,&f2) < 0 ) {
1722
1722
    long l1,l2;
1723
1723
 
1724
1724
    i1 = i2 = 0;
1725
 
    if ( ei_decode_long(*e1,&i1,&l1) < 0 ) {
 
1725
    if ( ei_decode_long((char *)*e1,&i1,&l1) < 0 ) {
1726
1726
        fprintf(stderr,"Failed to decode 1\r\n");
1727
1727
        return -1;
1728
1728
    }
1729
 
    if ( ei_decode_long(*e2,&i2,&l2) < 0 ) {
 
1729
    if ( ei_decode_long((char *)*e2,&i2,&l2) < 0 ) {
1730
1730
        fprintf(stderr,"Failed to decode 2\r\n");
1731
1731
        return 1;
1732
1732
    }
1745
1745
    double f1,f2;
1746
1746
 
1747
1747
    i1 = i2 = 0;
1748
 
    if ( ei_decode_double(*e1,&i1,&f1) < 0 ) return -1;
1749
 
    if ( ei_decode_double(*e2,&i2,&f2) < 0 ) return 1;
 
1748
    if ( ei_decode_double((char *)*e1,&i1,&f1) < 0 ) return -1;
 
1749
    if ( ei_decode_double((char *)*e2,&i2,&f2) < 0 ) return 1;
1750
1750
    
1751
1751
    *e1 += i1;
1752
1752
    *e2 += i2;
1763
1763
    erlang_big *b1,*b2;
1764
1764
 
1765
1765
    i1 = i2 = 0;
1766
 
    ei_get_type(*e1,&i1,&t1,&n1);
1767
 
    ei_get_type(*e2,&i2,&t2,&n2);
 
1766
    ei_get_type((char *)*e1,&i1,&t1,&n1);
 
1767
    ei_get_type((char *)*e2,&i2,&t2,&n2);
1768
1768
    
1769
1769
    b1 = ei_alloc_big(n1);
1770
1770
    b2 = ei_alloc_big(n2);
1771
1771
    
1772
 
    ei_decode_big(*e1,&i1,b1);
1773
 
    ei_decode_big(*e2,&i2,b2);
 
1772
    ei_decode_big((char *)*e1,&i1,b1);
 
1773
    ei_decode_big((char *)*e2,&i2,b2);
1774
1774
    
1775
1775
    res = ei_big_comp(b1,b2);
1776
1776