[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Toon-members] TooN/internal slice_error.hh
From: |
Gerhard Reitmayr |
Subject: |
[Toon-members] TooN/internal slice_error.hh |
Date: |
Mon, 21 Mar 2011 22:21:37 +0000 |
CVSROOT: /cvsroot/toon
Module name: TooN
Changes by: Gerhard Reitmayr <gerhard> 11/03/21 22:21:37
Modified files:
internal : slice_error.hh
Log message:
some missing conditions for Resizable objects
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/slice_error.hh?cvsroot=toon&r1=1.11&r2=1.12
Patches:
Index: slice_error.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/slice_error.hh,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- slice_error.hh 24 Aug 2009 13:22:13 -0000 1.11
+++ slice_error.hh 21 Mar 2011 22:21:37 -0000 1.12
@@ -64,7 +64,7 @@
{
static int n(int num)
{
- return Num==Dynamic?num:Num;
+ return (Num==Dynamic||Num==Resizable)?num:Num;
}
};
@@ -77,10 +77,10 @@
static void check()
{
//Sanity check all basic static sizes
- BadSlice<!(Size== Dynamic || Size > 0)>::check();
+ BadSlice<!(Size== Dynamic || Size==Resizable || Size >
0)>::check();
BadSlice<!(Start >= 0)>::check();
BadSlice<!(Length > 0)>::check();
- BadSlice<(Size != Dynamic && (Start + Length >
Size))>::check();
+ BadSlice<(Size != Dynamic && Size != Resizable &&
(Start + Length > Size))>::check();
}
///@internal
@@ -95,29 +95,29 @@
static void check(int size, int start, int length)
{
//Sanity check all basic static sizes
- BadSlice<!(Size == Dynamic || Size > 0)>::check();
+ BadSlice<!(Size == Dynamic || Size==Resizable || Size
> 0)>::check();
BadSlice<!(Start == Dynamic || Start >= 0)>::check();
BadSlice<!(Length == Dynamic || Length > 0)>::check();
//We can make sure Length <= Size, even if Start is
unknown
- BadSlice<(Size!=Dynamic && Length != Dynamic && Length
> Size)>::check();
+ BadSlice<(Size!=Dynamic && Size != Resizable && Length
!= Dynamic && Length > Size)>::check();
//We can make sure Start < Size even if Length is
unknown
- BadSlice<(Start != Dynamic && Size != Dynamic && Start
>= Size)>::check();
+ BadSlice<(Start != Dynamic && Size != Dynamic && Size
!= Resizable && Start >= Size)>::check();
- BadSlice<(Size != Dynamic && Start != Dynamic && Length
!= Dynamic && Start + Length > Size)>::check();
+ BadSlice<(Size != Dynamic && Size != Resizable && Start
!= Dynamic && Length != Dynamic && Start + Length > Size)>::check();
#ifndef TOON_NDEBUG_MISMATCH
- if(Start != Dynamic && Start != start)
+ if(Start != Dynamic && Size != Resizable &&
Start != start)
{
std::cerr << "TooN slice: mismatch
between static and dynamic start.\n";
std::abort();
}
- if(Length != Dynamic && Length != length)
+ if(Length != Dynamic && Size != Resizable &&
Length != length)
{
std::cerr << "TooN slice: mismatch
between static and dynamic length.\n";
std::abort();
}
- if(Size != Dynamic && Size != size)
+ if(Size != Dynamic && Size != Resizable && Size
!= size)
{
std::cerr << "TooN slice: mismatch
between static and dynamic size.\n";
std::abort();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Toon-members] TooN/internal slice_error.hh,
Gerhard Reitmayr <=