On Mon, Jul 28, 2008 at 06:10:05AM +0000, Martin Kersten wrote:
> Update of /cvsroot/monetdb/MonetDB5/src/modules/kernel
> In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6684/kernel
> 
> Modified Files:
>       batcalc.mx 
> Log Message:
> Oid unary accums are limited to '+'

Since there is IMHO no unary '+' operator defined in MAL, this is unused
("dead") code.
(In fact, I could not tell what the purpose/semantic of a unary '+' operator
should be...)

Moreover, the current code (for good?) also disables unary "--" & "++" for
type OID; hence, the current code is equivalent to a simple
" case TYPE_oid: throw(MAL, "[EMAIL PROTECTED]", "unexpected operator"); break;"
and could/should be simplified like this.

In fact, the part of the code that has been modified, i.e., the
"[EMAIL PROTECTED]" functions, are not used at all, yet, only the
"[EMAIL PROTECTED]" are used, but is actually the one that triggers
".\..\..\..\..\src\modules\kernel\batcalc.mx(923) : warning C4146: unary minus 
operator applied to unsigned type, result still unsigned"

I'd suggest to disable (remove?) the unused ("dead") code fo not (yet?) used
"[EMAIL PROTECTED]" and cleanup / simplify the code for "[EMAIL PROTECTED]" as
suggested above.

Stefan

> U batcalc.mx
> Index: batcalc.mx
> ===================================================================
> RCS file: /cvsroot/monetdb/MonetDB5/src/modules/kernel/batcalc.mx,v
> retrieving revision 1.152
> retrieving revision 1.153
> diff -u -d -r1.152 -r1.153
> --- batcalc.mx        21 Jul 2008 09:28:55 -0000      1.152
> +++ batcalc.mx        28 Jul 2008 06:10:02 -0000      1.153
> @@ -937,10 +937,22 @@
>  
>       switch(BATttype(bn)){
>       case TYPE_oid: if (  strcmp("@2","+")== 0){
> -                             @:accumUnary(oid,@2)@ 
> -                     } else
> -                             throw(MAL, "[EMAIL PROTECTED]", "unexpected 
> operator");
> -                     break;
> +                     oid* p = (oid*)Tloc(b,BUNfirst(b));
> +                     oid *q = (oid*)Tloc(b,BUNlast(b));
> +                     oid *o = (oid*)Tloc(bn,BUNfirst(bn));
> +
> +                     for(; p<q; p++, o++){
> +                             /* this code is better as x?nil:y  */
> +#ifdef NULLTST
> +                             if(*p == oid_nil )
> +                                     *o = oid_nil;
> +                             else 
> +#endif
> +                                     *o = *p;
> +                     }
> +             } else
> +                     throw(MAL, "[EMAIL PROTECTED]", "unexpected operator");
> +             break;
>       case TYPE_bte: @:accumUnary(bte,@2)@ break;
>       case TYPE_sht: @:accumUnary(sht,@2)@ break;
>       case TYPE_int: @:accumUnary(int,@2)@ break;
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Monetdb-checkins mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/monetdb-checkins
> 
> 
> 

-- 
| Dr. Stefan Manegold | mailto:[EMAIL PROTECTED] |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212       |
| The Netherlands     | Fax : +31 (20) 592-4312       |

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-developers

Reply via email to