~ubuntu-branches/ubuntu/oneiric/mpqc/oneiric

« back to all changes in this revision

Viewing changes to src/lib/util/state/stateout.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2005-11-27 11:41:49 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051127114149-zgz9r3gk50w8ww2q
Tags: 2.3.0-1
* New upstream release.
* debian/rules (SONAME): Activate awk snippet for automatic so-name
  detection again, resulting in a bump to `7' and making a `c2a' for
  the C++ allocator change unnecessary; closes: #339232.
* debian/patches/00list (08_gcc-4.0_fixes): Removed, no longer needed.
* debian/rules (test): Remove workarounds, do not abort build if tests
  fail.
* debian/ref: Removed.
* debian/control.in (libsc): Added Conflict against libsc6c2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#pragma implementation
30
30
#endif
31
31
 
32
 
#include <stdexcept>
33
32
#include <limits.h>
34
33
 
35
34
#include <scconfig.h>
46
45
#include <sys/types.h>
47
46
#endif
48
47
 
 
48
#include <util/class/scexception.h>
49
49
#include <util/state/translate.h>
50
50
#include <util/state/stateout.h>
51
51
 
143
143
 
144
144
int StateOut::put(char r) { return put_array_char(&r,1); }
145
145
int StateOut::put(unsigned int r) { return put_array_uint(&r,1); }
 
146
int StateOut::put(bool r) { return put(int(r)); }
146
147
int StateOut::put(int r) { return put_array_int(&r,1); }
147
148
int StateOut::put(float r) { return put_array_float(&r,1); }
148
149
int StateOut::put(double r) { return put_array_double(&r,1); }
149
150
int StateOut::put(unsigned long r)
150
151
{
151
152
  if (r > INT_MAX) {
152
 
      throw std::runtime_error("StateOut::put max allowed size exceeded");
 
153
      throw LimitExceeded<unsigned long>(
 
154
          "StateOut::put max allowed size exceeded",
 
155
          __FILE__, __LINE__, INT_MAX, r);
153
156
    }
154
157
  return put(int(r));
155
158
}