[kaffe] kaffeh and inner classes

Guilhem Lavaux guilhem at kaffe.org
Sat Jul 16 00:54:25 PDT 2005


Hi,

Thank you very much for your patch ! We are sometimes a bit low to
answer and sorry for that. I will try it and if it looks ok it will go
into CVS.

Regards,

Guilhem Lavaux.

On Fri, 2005-07-15 at 17:07 -0400, Kurt Miller wrote:
> From: "Kurt Miller" <truk at optonline.net>
> > can kaffeh be used on inner classes? 
> > 
> > It seems like it doesn't deal with the $ character correctly
> > and interprets it as a path separator.
> 
> Here's a patch that deals with the $ for inner classes.
> The "class name too long" check looks arbitrary to me.
> Not really sure where 100 comes from.
> 
> --- kaffe/kaffeh/main.c.orig	Mon May  3 01:53:27 2004
> +++ kaffe/kaffeh/main.c	Fri Jul 15 17:40:44 2005
> @@ -60,7 +60,7 @@
>  main(int argc, char* argv[])
>  {
>  	char* nm;
> -	int i, first = 1;
> +	int i, j, first = 1;
>  	int farg;
>  
>  	/* Process arguments */
> @@ -88,28 +88,37 @@
>  	for (nm = argv[farg]; nm != 0; nm = argv[++farg]) {
>  
>  		/* Derive various names from class name */
> -		for (i = 0; nm[i] != 0; i++) {
> -			if (i >= BUFSZ - 100) {
> +		for (i = j = 0; nm[i] != 0; i++, j++) {
> +			if (i >= BUFSZ - 100 || j >= BUFSZ - 105) {
>  				dprintf(
>  				    "kaffeh: class name too long\n");
>  				exit(1);
>  			}
>  			switch (nm[i]) {
>  			case '/':
> -			case '$':
>  			case '.':
> -				className[i] = '_';
> +				className[j] = '_';
>  				pathName[i] = '/';
>  				includeName[i] = '_';
>  				break;
> +			case '$':
> +				className[j++] = '_';
> +				className[j++] = '0';
> +				className[j++] = '0';
> +				className[j++] = '0';
> +				className[j++] = '2';
> +				className[j] = '4';
> +				pathName[i] = nm[i];
> +				includeName[i] = '_';
> +				break;
>  			default:
> -				className[i] = nm[i];
> +				className[j] = nm[i];
>  				pathName[i] = nm[i];
>  				includeName[i] = nm[i];
>  				break;
>  			}
>  		}
> -		className[i] = 0;
> +		className[j] = 0;
>  		pathName[i] = 0;
>  		includeName[i] = 0;
>  
> 
> _______________________________________________
> kaffe mailing list
> kaffe at kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe





More information about the kaffe mailing list