--===============0708483826== Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_ZtFm/jq+iNw57jz"; charset="iso-8859-1" Content-Transfer-Encoding: 7bit --Boundary-02=_ZtFm/jq+iNw57jz Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: signed data Content-Disposition: inline On Friday 24 October 2003 00:11, Boudewijn Rempt wrote: > void KoColor::RGBtoCMYK(int R, int G, int B, int *C, int *M, int *Y, > int *K) { > *C =3D 255 - R; > *M =3D 255 - G; > *Y =3D 255 - B; > > int min =3D (*C < *M) ? *C : *M; > *K =3D (min < *Y) ? min : *Y; > > *C =3D *C - *K; > *M =3D *M - *K; > *Y =3D *Y - *K; > } Wouldn't it be better to either check if the pointers are !=3D 0 or use int= &=20 instead of int*? As it seems you need all four parameters anyway, I think int& would be=20 better. Also makes the code easier to read, no explizit derefencing needed. Cheers, Kevin =2D-=20 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Kevin Krammer Developer at the Kmud Project http://www.kmud.de/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --Boundary-02=_ZtFm/jq+iNw57jz Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA/mFtZnKMhG6pzZJIRAvEiAJ9y0CkuGOPzw6yl8SgX6ZNDZv4FiACfVVrw Es4lOr8gKx8gCKRBmd6rF1g= =Q4qI -----END PGP SIGNATURE----- --Boundary-02=_ZtFm/jq+iNw57jz-- --===============0708483826== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel --===============0708483826==--