]> git.sur5r.net Git - openldap/blobdiff - libraries/liblunicode/ure/ure.c
Full implementation of server identity checking per RFC2830 section 3.6
[openldap] / libraries / liblunicode / ure / ure.c
index e36e9c0a9dfc5f5f3f67d9bc985242ed3cb6d11b..90cea614073b1d21c50079f3fd510c9c0ee18bdc 100644 (file)
@@ -25,9 +25,7 @@
  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
-#ifndef lint
-static char rcsid[] = "$Id: ure.c,v 1.2 1999/09/21 15:47:43 mleisher Exp $";
-#endif
+/* $Id: ure.c,v 1.2 1999/09/21 15:47:43 mleisher Exp $" */
 
 #include "portable.h"
 
@@ -1868,8 +1866,8 @@ ure_write_dfa(ure_dfa_t dfa, FILE *out)
                  */
                 if (0x10000 <= rp->min_code &&
                     rp->min_code <= 0x10ffff) {
-                    h = ((rp->min_code - 0x10000) >> 10) + 0xd800;
-                    l = ((rp->min_code - 0x10000) & 1023) + 0xdc00;
+                    h = (ucs2_t) (((rp->min_code - 0x10000) >> 10) + 0xd800);
+                    l = (ucs2_t) (((rp->min_code - 0x10000) & 1023) + 0xdc00);
                     fprintf(out, "\\x%04hX\\x%04hX", h, l);
                 } else
                   fprintf(out, "\\x%04lX", rp->min_code & 0xffff);
@@ -1877,8 +1875,8 @@ ure_write_dfa(ure_dfa_t dfa, FILE *out)
                     putc('-', out);
                     if (rp->max_code >= 0x10000 &&
                         rp->max_code <= 0x10ffff) {
-                        h = ((rp->max_code - 0x10000) >> 10) + 0xd800;
-                        l = ((rp->max_code - 0x10000) & 1023) + 0xdc00;
+                        h = (ucs2_t) (((rp->max_code - 0x10000) >> 10) + 0xd800);
+                        l = (ucs2_t) (((rp->max_code - 0x10000) & 1023) + 0xdc00);
                         fprintf(out, "\\x%04hX\\x%04hX", h, l);
                     } else
                       fprintf(out, "\\x%04lX", rp->max_code & 0xffff);
@@ -1908,8 +1906,8 @@ ure_write_dfa(ure_dfa_t dfa, FILE *out)
                     /*
                      * Take care of UTF16 characters.
                      */
-                    h = ((sym->sym.chr - 0x10000) >> 10) + 0xd800;
-                    l = ((sym->sym.chr - 0x10000) & 1023) + 0xdc00;
+                    h = (ucs2_t) (((sym->sym.chr - 0x10000) >> 10) + 0xd800);
+                    l = (ucs2_t) (((sym->sym.chr - 0x10000) & 1023) + 0xdc00);
                     fprintf(out, "\\x%04hX\\x%04hX ", h, l);
                 } else
                   fprintf(out, "\\x%04lX ", sym->sym.chr & 0xffff);