On Tue, Dec 02, 2008 at 08:57:48AM +0000, Martin Kersten wrote:
> Update of /cvsroot/monetdb/MonetDB5/src/modules/mal
> In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23226
> 
> Modified Files:
>       cluster.mx 
> Log Message:
> added the string clustering.

Martin,

what exactly is the purpose and/or intention of the MONET_OID32-dependent
choices below?

MONET_OID32 is ONLY defined when using 32-bit OIDs on 64-bit systems,
but in no other case.
In that case, type oid is 32-bit wide, just like type int.
The same hold for 32-bit systems, where OIDs are (obviously) always 32-bit.

When using 64-bit OIDs on 64-bit systems, type oid is 64-bit wide, just like
lng.

In either case, oid is unsigned, while int & lng are both signed.

Hence, either any code does support type oid, then this can and should be
used as such, i.e., no OID-width related alternatives are required.

Or there is no oid specific code, and the implementation hence needs to fall
back to alternative type of same width assuming that the signedness does not
matter (i.e., only copying and equality comparisons are used, but no
inequality comparisons), e.g., 32-bit int or 64-bit lng.

(Only!) in the latter case, I'd hence expect choices that look like

#if SIZEOF_OID == SIZEOF_INT
        /* use int code */
#else /* SIZEOF_OID == SIZEOF_LNG */
        /* use lng code */
#endif

Likewise for type var_t:

#if SIZEOF_VAR_T == SIZEOF_INT
        /* use int code */
#else /* SIZEOF_VAR_T == SIZEOF_LNG */
        /* use lng code */
#endif


Stefan


> U cluster.mx
> Index: cluster.mx
> ===================================================================
> RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/cluster.mx,v
> retrieving revision 1.13
> retrieving revision 1.14
> diff -u -d -r1.13 -r1.14
> --- cluster.mx        23 Nov 2008 23:12:31 -0000      1.13
> +++ cluster.mx        2 Dec 2008 08:57:46 -0000       1.14
[...]
> +#ifdef MONET_OID32
> +@:map_fixed(str,int)@
> +#else
> +@:map_fixed(str,oid)@
> +#endif
[...]
> +#ifdef MONET_OID32
> +             if( sizeof(var_t)== sizeof(int)) {
> +                     CLUSTER_column_int(nb, b, cmap);
> +                     break;
> +             }
> +#else
> +             if( sizeof(var_t)== sizeof(oid)) {
> +                     CLUSTER_column_oid(nb, b, cmap);
> +                     break;
> +             } else
> +#endif
[...]

-- 
| 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