~ubuntu-branches/debian/experimental/mednafen/experimental

« back to all changes in this revision

Viewing changes to intl/xsize.h

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2012-01-31 07:21:35 UTC
  • mfrom: (1.2.8)
  • Revision ID: package-import@ubuntu.com-20120131072135-es3dj12y00xcnrsk
Tags: 0.9.19-1
* New upstream WIP version.
* Update copyright information.
* Refresh use-system-tremor.patch and remove psx-big-endian-only.patch.
* Add spelling-fixes.patch based on Lintian's recommendations.
* Build-depend on debhelper 9 or later and remove corresponding Lintian
  override.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* xsize.h -- Checked size_t computations.
2
2
 
3
 
   Copyright (C) 2003 Free Software Foundation, Inc.
 
3
   Copyright (C) 2003, 2008 Free Software Foundation, Inc.
4
4
 
5
5
   This program is free software; you can redistribute it and/or modify it
6
6
   under the terms of the GNU Library General Public License as published
95
95
/* Multiplication of a count with an element size, with overflow check.
96
96
   The count must be >= 0 and the element size must be > 0.
97
97
   This is a macro, not an inline function, so that it works correctly even
98
 
   when N is of a wider tupe and N > SIZE_MAX.  */
 
98
   when N is of a wider type and N > SIZE_MAX.  */
99
99
#define xtimes(N, ELSIZE) \
100
100
  ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
101
101