diff options
author | Thomas White <taw@physics.org> | 2010-02-26 23:41:40 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-02-27 10:51:20 +0100 |
commit | 6b345bb3ab13139cff8ca5b7fdc551110eaaddea (patch) | |
tree | fb582246cb5086964b14a11c32411373b5b80790 /src/pattern_sim.c | |
parent | d9d216421ce1a6e692cbd06e7b1aab02d26faf84 (diff) |
Fix type conversions to avoid trouble with overflows etc.
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r-- | src/pattern_sim.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c index 91100426..59e5adb5 100644 --- a/src/pattern_sim.c +++ b/src/pattern_sim.c @@ -307,6 +307,9 @@ int main(int argc, char *argv[]) for ( x=0; x<image.width; x++ ) { for ( y=0; y<image.height; y++ ) { powder[x+w*y] += image.data[x+w*y]; + if ( image.data[x+w*y] < 0 ) { + STATUS("Negative! %f %i %i\n", image.data[x+w*y], x, y); + } } } |