summaryrefslogtreecommitdiff
path: root/lisp/url
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2005-05-16 10:07:59 +0000
committerJuanma Barranquero <lekktu@gmail.com>2005-05-16 10:07:59 +0000
commit216d380630ec8be9569a56687f0e08b89ee97c47 (patch)
tree3e4277a92220cf7828d5a9b8a7ea158a6bea0396 /lisp/url
parentcc211a0ff8145e0814413e237bb5674d615968b7 (diff)
downloademacs-216d380630ec8be9569a56687f0e08b89ee97c47.tar.gz
Replace `string-to-int' by `string-to-number'.
Diffstat (limited to 'lisp/url')
-rw-r--r--lisp/url/ChangeLog13
-rw-r--r--lisp/url/url-auth.el2
-rw-r--r--lisp/url/url-cookie.el24
-rw-r--r--lisp/url/url-dav.el22
-rw-r--r--lisp/url/url-http.el10
-rw-r--r--lisp/url/url-ns.el6
-rw-r--r--lisp/url/url-parse.el2
-rw-r--r--lisp/url/url-util.el2
8 files changed, 47 insertions, 34 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index a023bdf18c7..f6c75639d6f 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,16 @@
+2005-05-06 Juanma Barranquero <lekktu@gmail.com>
+
+ * url-auth.el (url-register-auth-scheme):
+ * url-cookie.el (url-cookie-expired-p):
+ * url-dav.el (url-dav-process-date-property)
+ (url-dav-process-boolean-property, url-dav-process-DAV:status):
+ * url-http.el (url-http-chunked-encoding-after-change-function)
+ (url-http-wait-for-headers-change-function):
+ * url-ns.el (isInNet):
+ * url-parse.el (url-generic-parse-url):
+ * url-util.el (url-get-normalized-date): Replace `string-to-int'
+ by `string-to-number'.
+
2005-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
* url.el (url-retrieve-synchronously): Work around the fact that
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index 260315c5d54..ea208ccadea 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -293,7 +293,7 @@ RATING a rating between 1 and 10 of the strength of the authentication.
(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))
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el
index 9f7db867597..ba13d3d7a8d 100644
--- a/lisp/url/url-cookie.el
+++ b/lisp/url/url-cookie.el
@@ -208,13 +208,13 @@ telling Microsoft that.")
(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 @@ telling Microsoft that.")
(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
diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el
index d6c5ffffa43..a0f1ae1ebe7 100644
--- a/lisp/url/url-dav.el
+++ b/lisp/url/url-dav.el
@@ -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)
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 872ea22ce05..16d51a0258c 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -827,10 +827,10 @@ the end of the document."
'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 @@ the end of the document."
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
diff --git a/lisp/url/url-ns.el b/lisp/url/url-ns.el
index fe181422e4f..1dcb1f85f27 100644
--- a/lisp/url/url-ns.el
+++ b/lisp/url/url-ns.el
@@ -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)))
diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el
index 97348ab5db2..5b5250ab31f 100644
--- a/lisp/url/url-parse.el
+++ b/lisp/url/url-parse.el
@@ -167,7 +167,7 @@ Format is:
(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))))
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index 1d0bfcf0c48..b796d695461 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -196,7 +196,7 @@ Will not do anything if `url-show-status' is nil."
(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))