YASIM: minor corrections and safeguards.
This commit is contained in:
parent
ea8bfba98a
commit
3ac90ee866
3 changed files with 11 additions and 5 deletions
|
@ -211,7 +211,7 @@ bool Atmosphere::test() {
|
|||
fprintf(stderr, "Columns = %d\n", numColumns);
|
||||
fprintf(stderr, "Rows = %d\n", rows);
|
||||
|
||||
for (int alt = 0; alt < maxTableIndex(); alt++) {
|
||||
for (int alt = 0; alt <= maxTableIndex(); alt++) {
|
||||
float density = calcStdDensity(data[alt][PRESSURE], data[alt][TEMPERATURE]);
|
||||
float delta = data[alt][DENSITY] - density;
|
||||
fprintf(stderr, "%d : %f \n", alt, delta);
|
||||
|
|
|
@ -136,7 +136,8 @@ int ControlMap::getOutputHandle(void* obj, int type)
|
|||
if(o->object == obj && o->type == type)
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
fprintf(stderr, "ControlMap::getOutputHandle cannot find *%d, type %d \n", obj, type);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ControlMap::setTransitionTime(int handle, float time)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef _VECTOR_HPP
|
||||
#define _VECTOR_HPP
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cassert>
|
||||
//
|
||||
// Excruciatingly simple vector-of-pointers class. Easy & useful.
|
||||
// No support for addition of elements anywhere but at the end of the
|
||||
|
@ -46,11 +48,14 @@ inline int Vector::add(void* p)
|
|||
|
||||
inline void* Vector::get(int i) const
|
||||
{
|
||||
assert(i >= 0 and i < _sz);
|
||||
return _array[i];
|
||||
|
||||
}
|
||||
|
||||
inline void Vector::set(int i, void* p)
|
||||
{
|
||||
assert(i >= 0 and i < _sz);
|
||||
_array[i] = p;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue