<p dir="ltr"><br>
El 25/03/2015 21:41, "Joel Sherrill" <<a href="mailto:joel.sherrill@oarcorp.com">joel.sherrill@oarcorp.com</a>> escribió:<br>
><br>
><br>
><br>
> On March 24, 2015 8:37:57 AM CDT, Daniel Gutson <<a href="mailto:daniel.gutson@tallertechnologies.com">daniel.gutson@tallertechnologies.com</a>> wrote:<br>
> >In order to avoid code duplication and ease future bugfixing, I suggest<br>
> >to have a conditional casting and leave the core code alone, something<br>
> >like<br>
> ><br>
> >#ifdef __rtems__<br>
> >#define cast(x) ((unsigned long int)x)<br>
> >#else<br>
> >#define cast(x) (x)<br>
> >#endif<br>
> ><br>
> >...cast(final[ 0] << 16)...<br>
> ><br>
> >#undef cast<br>
><br>
> Good suggestion. The big concern is really just making sure changes made to the imported code is clear. I suppose this does it as well.</p>
<p dir="ltr">Is this really RTEMS-specific? If it isn't, what about contributing it to the original code?</p>
<p dir="ltr">><br>
><br>
> >El 23/03/2015 11:52, "Joel Sherrill" <<a href="mailto:joel.sherrill@oarcorp.com">joel.sherrill@oarcorp.com</a>><br>
> >escribió:<br>
> ><br>
> >---<br>
> > cpukit/libcrypt/crypt-md5.c | 12 ++++++++++++<br>
> > 1 file changed, 12 insertions(+)<br>
> ><br>
> >diff --git a/cpukit/libcrypt/crypt-md5.c b/cpukit/libcrypt/crypt-md5.c<br>
> >index c60dcf8..78ae0bc 100644<br>
> >--- a/cpukit/libcrypt/crypt-md5.c<br>
> >+++ b/cpukit/libcrypt/crypt-md5.c<br>
> >@@ -133,6 +133,17 @@ crypt_md5_r(const char *pw, const char *salt,<br>
> >struct crypt_data *data)<br>
> ><br>
> > p = passwd + strlen(passwd);<br>
> ><br>
> >+#if defined(__rtems__)<br>
> >+ l = ((long int) final[ 0]<<16) | ((long int) final[ 6]<<8) |<br>
> >final[12];<br>
> >+ _crypt_to64(p, l, 4); p += 4;<br>
> >+ l = ((long int) final[ 1]<<16) | ((long int) final[ 7]<<8) |<br>
> >final[13];<br>
> >+ _crypt_to64(p, l, 4); p += 4;<br>
> >+ l = ((long int) final[ 2]<<16) | ((long int) final[ 8]<<8) |<br>
> >final[14];<br>
> >+ _crypt_to64(p, l, 4); p += 4;<br>
> >+ l = ((long int) final[ 3]<<16) | ((long int) final[ 9]<<8) |<br>
> >final[15];<br>
> >+ _crypt_to64(p, l, 4); p += 4;<br>
> >+ l = ((long int) final[ 4]<<16) | ((long int) final[10]<<8) |<br>
> >final[ 5];<br>
> >+#else<br>
> > l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];<br>
> > _crypt_to64(p, l, 4); p += 4;<br>
> > l = (final[ 1]<<16) | (final[ 7]<<8) | final[13];<br>
> >@@ -142,6 +153,7 @@ crypt_md5_r(const char *pw, const char *salt,<br>
> >struct crypt_data *data)<br>
> > l = (final[ 3]<<16) | (final[ 9]<<8) | final[15];<br>
> > _crypt_to64(p, l, 4); p += 4;<br>
> > l = (final[ 4]<<16) | (final[10]<<8) | final[ 5];<br>
> >+#endif<br>
> > _crypt_to64(p, l, 4); p += 4;<br>
> > l = final[11];<br>
> > _crypt_to64(p, l, 2); p += 2;<br>
> >--<br>
> >1.9.3<br>
> ><br>
> >_______________________________________________<br>
> >devel mailing list<br>
> ><a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
> ><a href="http://lists.rtems.org/mailman/listinfo/devel">http://lists.rtems.org/mailman/listinfo/devel</a><br>
><br>
> --joel<br>
</p>