dmd 178 changes

Thomas Kuehne thomas-dloop at kuehne.cn
Sun Dec 10 22:18:41 PST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ant schrieb am 2006-12-11:
> ok, I jump a few releases and missed a lot of discussions...
>
> this isn't valid anymore:
>
> 	/**
> 	 * get the C version of command line in the format char**
> 	 */
> 	static char** getCommandLine(char[][] args)
> 	{		
> 		// Walter version from a post on the D news group
> 		char** argv = new char*[args.length];
> 		int i = 0;
> 		foreach (char[] p; args)
> 		{
> 			argv[i++] = cast(char*)p;
> 		}
> 		return argv;

DMD-0.177: Arrays no longer implicitly convert to pointers unless -d is used.

	/**
	 * get the C version of command line in the format char**
	 */
	static char** getCommandLine(char[][] args)
	{		
		// Walter version from a post on the D news group
		char** argv = (new char*[args.length]).ptr;
		int i = 0;
		foreach (char[] p; args)
		{
			argv[i++] = p.ptr;
		}
		return argv;
	}
Thomas

-----BEGIN PGP SIGNATURE-----

iD8DBQFFfQTbLK5blCcjpWoRAuFpAJ9Y9DYi9fMGx1xKKxzao+HwUeiQjQCfZL6H
pZj5wV/AHDVFBwniikYlBuI=
=LAOW
-----END PGP SIGNATURE-----


More information about the Digitalmars-d-learn mailing list