.ad 8
.bm 8
.fm 4
.bt $Copyright by   SAP AG, 1994$$Page %$
.tm 12
.hm 6
.hs 3
.tt 1 $SQL$Project Distributed Database System$VSP25$
.tt 2 $$$
.tt 3 $ElkeZ$Set-Integer-Conversions$1994-01-21$
***********************************************************
.nf


    ========== licence begin LGPL
    Copyright (C) 2000 SAP AG

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    ========== licence end

.fo
.nf
.sp
MODULE  : Set-Integer-Conversions
=========
.sp
Purpose : Builds a warningset out of an int2 or vice versa
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
        PROCEDURE
              s25pwarn (ws : tsp_warningset;
                    VAR warnint : tsp_int2);
 
        PROCEDURE
              s25gwarn (VAR ws : tsp_warningset;
                    warnint : tsp_int2);
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : ElkeZ
.sp
.cp 3
Created : 1987-08-20
.sp
.cp 3
Version : 1994-01-21
.sp
.cp 3
Release :  3.1.3 	 Date : 1994-01-21
.sp
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Specification:
 
 
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:
 
 
.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.nf
.oc _/1
Structure:
 
.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.oc _/1
.CM -lll-
Code    :
 
 
(*------------------------------*) 
 
PROCEDURE
      s25pwarn (ws : tsp_warningset;
            VAR warnint : tsp_int2);
 
VAR
      w : tsp_warnings;
      intval : integer;
 
BEGIN
warnint:= -32768;
intval:= 16384;
FOR w:= warn1 TO warn15_serverdb_not_in_majority DO
    BEGIN
    IF  w in ws
    THEN
        warnint:= warnint + intval;
    (*ENDIF*) 
    intval:= intval DIV 2
    END
(*ENDFOR*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      s25gwarn (VAR ws : tsp_warningset;
            warnint : tsp_int2);
 
VAR
      i : tsp_int2;
      w : tsp_warnings;
      intval : integer;
 
BEGIN
ws:= [ warn0_exist ];
i:= -32768;
intval:= 16384;
FOR w:= warn1 TO warn15_serverdb_not_in_majority DO
    BEGIN
    IF  i + intval <= warnint
    THEN
        BEGIN
        i:= i + intval;
        ws:= ws + [ w ]
        END;
    (*ENDIF*) 
    intval:= intval DIV 2
    END
(*ENDFOR*) 
END;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
*-PRETTY-*  statements    :         14
*-PRETTY-*  lines of code :         52        PRETTY  3.09 
*-PRETTY-*  lines in file :        149         1992-11-23 
.PA 
