X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fmipsstrops.lisp;h=42708c6279fe8bd0bb453e94283f76f9e261a723;hb=23c0c48f562d7dc5d1615bf13cb831b46c91d106;hp=6f98979f02c059f3b2342d5766954db3419847a5;hpb=2695f20cc74e0693f184fa5c7327d4c557e5537f;p=sbcl.git diff --git a/src/code/mipsstrops.lisp b/src/code/mipsstrops.lisp index 6f98979..42708c6 100644 --- a/src/code/mipsstrops.lisp +++ b/src/code/mipsstrops.lisp @@ -18,62 +18,62 @@ ;;; the shorter is a prefix of the longer, the length of the shorter + ;;; START1 is returned. The arguments must be simple strings. ;;; -;;; This would be done on the Vax with CMPC3. +;;; This would be done on the Vax with CMPC3. (defun %sp-string-compare (string1 start1 end1 string2 start2 end2) (declare (simple-string string1 string2)) (declare (fixnum start1 end1 start2 end2)) (let ((len1 (- end1 start1)) - (len2 (- end2 start2))) + (len2 (- end2 start2))) (declare (fixnum len1 len2)) (cond ((= len1 len2) (do ((index1 start1 (1+ index1)) - (index2 start2 (1+ index2))) - ((= index1 end1) nil) - (declare (fixnum index1 index2)) - (if (char/= (schar string1 index1) (schar string2 index2)) - (return index1)))) + (index2 start2 (1+ index2))) + ((= index1 end1) nil) + (declare (fixnum index1 index2)) + (if (char/= (schar string1 index1) (schar string2 index2)) + (return index1)))) ((> len1 len2) (do ((index1 start1 (1+ index1)) - (index2 start2 (1+ index2))) - ((= index2 end2) index1) - (declare (fixnum index1 index2)) - (if (char/= (schar string1 index1) (schar string2 index2)) - (return index1)))) + (index2 start2 (1+ index2))) + ((= index2 end2) index1) + (declare (fixnum index1 index2)) + (if (char/= (schar string1 index1) (schar string2 index2)) + (return index1)))) (t (do ((index1 start1 (1+ index1)) - (index2 start2 (1+ index2))) - ((= index1 end1) index1) - (declare (fixnum index1 index2)) - (if (char/= (schar string1 index1) (schar string2 index2)) - (return index1))))))) + (index2 start2 (1+ index2))) + ((= index1 end1) index1) + (declare (fixnum index1 index2)) + (if (char/= (schar string1 index1) (schar string2 index2)) + (return index1))))))) ;;; like %SP-STRING-COMPARE, only backwards (defun %sp-reverse-string-compare (string1 start1 end1 string2 start2 end2) (declare (simple-string string1 string2)) (declare (fixnum start1 end1 start2 end2)) (let ((len1 (- end1 start1)) - (len2 (- end2 start2))) + (len2 (- end2 start2))) (declare (fixnum len1 len2)) (cond ((= len1 len2) (do ((index1 (1- end1) (1- index1)) - (index2 (1- end2) (1- index2))) - ((< index1 start1) nil) - (declare (fixnum index1 index2)) - (if (char/= (schar string1 index1) (schar string2 index2)) - (return index1)))) + (index2 (1- end2) (1- index2))) + ((< index1 start1) nil) + (declare (fixnum index1 index2)) + (if (char/= (schar string1 index1) (schar string2 index2)) + (return index1)))) ((> len1 len2) (do ((index1 (1- end1) (1- index1)) - (index2 (1- end2) (1- index2))) - ((< index2 start2) index1) - (declare (fixnum index1 index2)) - (if (char/= (schar string1 index1) (schar string2 index2)) - (return index1)))) + (index2 (1- end2) (1- index2))) + ((< index2 start2) index1) + (declare (fixnum index1 index2)) + (if (char/= (schar string1 index1) (schar string2 index2)) + (return index1)))) (t (do ((index1 (1- end1) (1- index1)) - (index2 (1- end2) (1- index2))) - ((< index1 start1) index1) - (declare (fixnum index1 index2)) - (if (char/= (schar string1 index1) (schar string2 index2)) - (return index1))))))) + (index2 (1- end2) (1- index2))) + ((< index1 start1) index1) + (declare (fixnum index1 index2)) + (if (char/= (schar string1 index1) (schar string2 index2)) + (return index1)))))))