changeset 62400:e30c08177a3b

Replace `string-to-int' by `string-to-number'.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 16 May 2005 10:07:31 +0000
parents 87fca255126a
children 4512c4db6912
files lisp/url/url-auth.el lisp/url/url-cookie.el lisp/url/url-dav.el lisp/url/url-http.el lisp/url/url-ns.el lisp/url/url-parse.el lisp/url/url-util.el
diffstat 7 files changed, 34 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/url/url-auth.el	Mon May 16 08:36:21 2005 +0000
+++ b/lisp/url/url-auth.el	Mon May 16 10:07:31 2005 +0000
@@ -293,7 +293,7 @@
 	 (function (or function (intern (concat "url-" type "-auth"))))
 	 (rating (cond
 		  ((null rating) 2)
-		  ((stringp rating) (string-to-int rating))
+		  ((stringp rating) (string-to-number rating))
 		  (t rating)))
 	 (node (assoc type url-registered-auth-schemes)))
     (if (not (fboundp function))
--- a/lisp/url/url-cookie.el	Mon May 16 08:36:21 2005 +0000
+++ b/lisp/url/url-cookie.el	Mon May 16 10:07:31 2005 +0000
@@ -208,13 +208,13 @@
 	 (cur-date (and exp (timezone-parse-date (current-time-string))))
 	 (exp-date (and exp (timezone-parse-date exp)))
 	 (cur-greg (and cur-date (timezone-absolute-from-gregorian
-				  (string-to-int (aref cur-date 1))
-				  (string-to-int (aref cur-date 2))
-				  (string-to-int (aref cur-date 0)))))
+				  (string-to-number (aref cur-date 1))
+				  (string-to-number (aref cur-date 2))
+				  (string-to-number (aref cur-date 0)))))
 	 (exp-greg (and exp (timezone-absolute-from-gregorian
-			     (string-to-int (aref exp-date 1))
-			     (string-to-int (aref exp-date 2))
-			     (string-to-int (aref exp-date 0)))))
+			     (string-to-number (aref exp-date 1))
+			     (string-to-number (aref exp-date 2))
+			     (string-to-number (aref exp-date 0)))))
 	 (diff-in-days (and exp (- cur-greg exp-greg)))
 	 )
     (cond
@@ -224,12 +224,12 @@
      (t					; Expires sometime today, check times
       (let* ((cur-time (timezone-parse-time (aref cur-date 3)))
 	     (exp-time (timezone-parse-time (aref exp-date 3)))
-	     (cur-norm (+ (* 360 (string-to-int (aref cur-time 2)))
-			  (*  60 (string-to-int (aref cur-time 1)))
-			  (*   1 (string-to-int (aref cur-time 0)))))
-	     (exp-norm (+ (* 360 (string-to-int (aref exp-time 2)))
-			  (*  60 (string-to-int (aref exp-time 1)))
-			  (*   1 (string-to-int (aref exp-time 0))))))
+	     (cur-norm (+ (* 360 (string-to-number (aref cur-time 2)))
+			  (*  60 (string-to-number (aref cur-time 1)))
+			  (*   1 (string-to-number (aref cur-time 0)))))
+	     (exp-norm (+ (* 360 (string-to-number (aref exp-time 2)))
+			  (*  60 (string-to-number (aref exp-time 1)))
+			  (*   1 (string-to-number (aref exp-time 0))))))
 	(> (- cur-norm exp-norm) 1))))))
 
 ;;;###autoload
--- a/lisp/url/url-dav.el	Mon May 16 08:36:21 2005 +0000
+++ b/lisp/url/url-dav.el	Mon May 16 10:07:31 2005 +0000
@@ -121,17 +121,17 @@
 
     ;; Nobody else handles iso8601 correctly, lets do it ourselves.
     (when (string-match date-re date-string re-start)
-      (setq year (string-to-int (match-string 1 date-string))
-	    month (string-to-int (match-string 2 date-string))
-	    day (string-to-int (match-string 3 date-string))
+      (setq year (string-to-number (match-string 1 date-string))
+	    month (string-to-number (match-string 2 date-string))
+	    day (string-to-number (match-string 3 date-string))
 	    re-start (match-end 0))
       (when (string-match time-re date-string re-start)
-	(setq hour (string-to-int (match-string 1 date-string))
-	      minute (string-to-int (match-string 2 date-string))
-	      seconds (string-to-int (match-string 3 date-string))
-	      fractional-seconds (string-to-int (or
-						 (match-string 4 date-string)
-						 "0"))
+	(setq hour (string-to-number (match-string 1 date-string))
+	      minute (string-to-number (match-string 2 date-string))
+	      seconds (string-to-number (match-string 3 date-string))
+	      fractional-seconds (string-to-number (or
+                                                    (match-string 4 date-string)
+                                                    "0"))
 	      re-start (match-end 0))
 	(when (string-match tz-re date-string re-start)
 	  (setq tz (match-string 1 date-string)))
@@ -149,7 +149,7 @@
     time))
 
 (defun url-dav-process-boolean-property (node)
-  (/= 0 (string-to-int (url-dav-node-text node))))
+  (/= 0 (string-to-number (url-dav-node-text node))))
 
 (defun url-dav-process-uri-property (node)
   ;; Returns a parsed representation of the URL...
@@ -318,7 +318,7 @@
   ;; only care about the numeric status code.
   (let ((status (url-dav-node-text node)))
     (if (string-match "\\`[ \r\t\n]*HTTP/[0-9.]+ \\([0-9]+\\)" status)
-	(string-to-int (match-string 1 status))
+	(string-to-number (match-string 1 status))
       500)))
 
 (defun url-dav-process-DAV:propstat (node)
--- a/lisp/url/url-http.el	Mon May 16 08:36:21 2005 +0000
+++ b/lisp/url/url-http.el	Mon May 16 10:07:31 2005 +0000
@@ -827,10 +827,10 @@
 						 'text-cursor
 					       'cursor)
 				       'invisible t))
-	    (setq url-http-chunked-length (string-to-int (buffer-substring
-							  (match-beginning 1)
-							  (match-end 1))
-							 16)
+	    (setq url-http-chunked-length (string-to-number (buffer-substring
+                                                             (match-beginning 1)
+                                                             (match-end 1))
+                                                            16)
 		  url-http-chunked-counter (1+ url-http-chunked-counter)
 		  url-http-chunked-start (set-marker
 					  (or url-http-chunked-start
@@ -904,7 +904,7 @@
 		    url-http-content-type (mail-fetch-field "content-type"))
 	      (if (mail-fetch-field "content-length")
 		  (setq url-http-content-length
-			(string-to-int (mail-fetch-field "content-length"))))
+			(string-to-number (mail-fetch-field "content-length"))))
 	      (widen)))
 	  (if url-http-transfer-encoding
 	      (setq url-http-transfer-encoding
--- a/lisp/url/url-ns.el	Mon May 16 08:36:21 2005 +0000
+++ b/lisp/url/url-ns.el	Mon May 16 10:07:31 2005 +0000
@@ -51,9 +51,9 @@
     (if (or (/= (length netc) (length ipc))
 	    (/= (length ipc) (length maskc)))
 	nil
-      (setq netc (mapcar 'string-to-int netc)
-	    ipc (mapcar 'string-to-int ipc)
-	    maskc (mapcar 'string-to-int maskc))
+      (setq netc (mapcar 'string-to-number netc)
+	    ipc (mapcar 'string-to-number ipc)
+	    maskc (mapcar 'string-to-number maskc))
       (and
        (= (logand (nth 0 netc) (nth 0 maskc))
 	  (logand (nth 0 ipc)  (nth 0 maskc)))
--- a/lisp/url/url-parse.el	Mon May 16 08:36:21 2005 +0000
+++ b/lisp/url/url-parse.el	Mon May 16 10:07:31 2005 +0000
@@ -167,7 +167,7 @@
 		  (setq pass (match-string 2 user)
 			user (match-string 1 user)))
 	      (if (string-match ":\\([0-9+]+\\)" host)
-		  (setq port (string-to-int (match-string 1 host))
+		  (setq port (string-to-number (match-string 1 host))
 			host (substring host 0 (match-beginning 0))))
 	      (if (string-match ":$" host)
 		  (setq host (substring host 0 (match-beginning 0))))
--- a/lisp/url/url-util.el	Mon May 16 08:36:21 2005 +0000
+++ b/lisp/url/url-util.el	Mon May 16 10:07:31 2005 +0000
@@ -196,7 +196,7 @@
 	 (year nil)
 	 (month (car
 		 (rassoc
-		  (string-to-int (aref parsed 1)) url-monthabbrev-alist)))
+		  (string-to-number (aref parsed 1)) url-monthabbrev-alist)))
 	 )
     (setq day (or (car-safe (rassoc day url-weekday-alist))
 		  (substring raw 0 3))