diff options
| author | Juanma Barranquero | 2005-05-16 10:07:59 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2005-05-16 10:07:59 +0000 |
| commit | 216d380630ec8be9569a56687f0e08b89ee97c47 (patch) | |
| tree | 3e4277a92220cf7828d5a9b8a7ea158a6bea0396 | |
| parent | cc211a0ff8145e0814413e237bb5674d615968b7 (diff) | |
| download | emacs-216d380630ec8be9569a56687f0e08b89ee97c47.tar.gz emacs-216d380630ec8be9569a56687f0e08b89ee97c47.zip | |
Replace `string-to-int' by `string-to-number'.
| -rw-r--r-- | lisp/url/ChangeLog | 13 | ||||
| -rw-r--r-- | lisp/url/url-auth.el | 2 | ||||
| -rw-r--r-- | lisp/url/url-cookie.el | 24 | ||||
| -rw-r--r-- | lisp/url/url-dav.el | 22 | ||||
| -rw-r--r-- | lisp/url/url-http.el | 10 | ||||
| -rw-r--r-- | lisp/url/url-ns.el | 6 | ||||
| -rw-r--r-- | lisp/url/url-parse.el | 2 | ||||
| -rw-r--r-- | lisp/url/url-util.el | 2 |
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 @@ | |||
| 1 | 2005-05-06 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * url-auth.el (url-register-auth-scheme): | ||
| 4 | * url-cookie.el (url-cookie-expired-p): | ||
| 5 | * url-dav.el (url-dav-process-date-property) | ||
| 6 | (url-dav-process-boolean-property, url-dav-process-DAV:status): | ||
| 7 | * url-http.el (url-http-chunked-encoding-after-change-function) | ||
| 8 | (url-http-wait-for-headers-change-function): | ||
| 9 | * url-ns.el (isInNet): | ||
| 10 | * url-parse.el (url-generic-parse-url): | ||
| 11 | * url-util.el (url-get-normalized-date): Replace `string-to-int' | ||
| 12 | by `string-to-number'. | ||
| 13 | |||
| 1 | 2005-04-18 Stefan Monnier <monnier@iro.umontreal.ca> | 14 | 2005-04-18 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 15 | ||
| 3 | * url.el (url-retrieve-synchronously): Work around the fact that | 16 | * 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. | |||
| 293 | (function (or function (intern (concat "url-" type "-auth")))) | 293 | (function (or function (intern (concat "url-" type "-auth")))) |
| 294 | (rating (cond | 294 | (rating (cond |
| 295 | ((null rating) 2) | 295 | ((null rating) 2) |
| 296 | ((stringp rating) (string-to-int rating)) | 296 | ((stringp rating) (string-to-number rating)) |
| 297 | (t rating))) | 297 | (t rating))) |
| 298 | (node (assoc type url-registered-auth-schemes))) | 298 | (node (assoc type url-registered-auth-schemes))) |
| 299 | (if (not (fboundp function)) | 299 | (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.") | |||
| 208 | (cur-date (and exp (timezone-parse-date (current-time-string)))) | 208 | (cur-date (and exp (timezone-parse-date (current-time-string)))) |
| 209 | (exp-date (and exp (timezone-parse-date exp))) | 209 | (exp-date (and exp (timezone-parse-date exp))) |
| 210 | (cur-greg (and cur-date (timezone-absolute-from-gregorian | 210 | (cur-greg (and cur-date (timezone-absolute-from-gregorian |
| 211 | (string-to-int (aref cur-date 1)) | 211 | (string-to-number (aref cur-date 1)) |
| 212 | (string-to-int (aref cur-date 2)) | 212 | (string-to-number (aref cur-date 2)) |
| 213 | (string-to-int (aref cur-date 0))))) | 213 | (string-to-number (aref cur-date 0))))) |
| 214 | (exp-greg (and exp (timezone-absolute-from-gregorian | 214 | (exp-greg (and exp (timezone-absolute-from-gregorian |
| 215 | (string-to-int (aref exp-date 1)) | 215 | (string-to-number (aref exp-date 1)) |
| 216 | (string-to-int (aref exp-date 2)) | 216 | (string-to-number (aref exp-date 2)) |
| 217 | (string-to-int (aref exp-date 0))))) | 217 | (string-to-number (aref exp-date 0))))) |
| 218 | (diff-in-days (and exp (- cur-greg exp-greg))) | 218 | (diff-in-days (and exp (- cur-greg exp-greg))) |
| 219 | ) | 219 | ) |
| 220 | (cond | 220 | (cond |
| @@ -224,12 +224,12 @@ telling Microsoft that.") | |||
| 224 | (t ; Expires sometime today, check times | 224 | (t ; Expires sometime today, check times |
| 225 | (let* ((cur-time (timezone-parse-time (aref cur-date 3))) | 225 | (let* ((cur-time (timezone-parse-time (aref cur-date 3))) |
| 226 | (exp-time (timezone-parse-time (aref exp-date 3))) | 226 | (exp-time (timezone-parse-time (aref exp-date 3))) |
| 227 | (cur-norm (+ (* 360 (string-to-int (aref cur-time 2))) | 227 | (cur-norm (+ (* 360 (string-to-number (aref cur-time 2))) |
| 228 | (* 60 (string-to-int (aref cur-time 1))) | 228 | (* 60 (string-to-number (aref cur-time 1))) |
| 229 | (* 1 (string-to-int (aref cur-time 0))))) | 229 | (* 1 (string-to-number (aref cur-time 0))))) |
| 230 | (exp-norm (+ (* 360 (string-to-int (aref exp-time 2))) | 230 | (exp-norm (+ (* 360 (string-to-number (aref exp-time 2))) |
| 231 | (* 60 (string-to-int (aref exp-time 1))) | 231 | (* 60 (string-to-number (aref exp-time 1))) |
| 232 | (* 1 (string-to-int (aref exp-time 0)))))) | 232 | (* 1 (string-to-number (aref exp-time 0)))))) |
| 233 | (> (- cur-norm exp-norm) 1)))))) | 233 | (> (- cur-norm exp-norm) 1)))))) |
| 234 | 234 | ||
| 235 | ;;;###autoload | 235 | ;;;###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 @@ | |||
| 121 | 121 | ||
| 122 | ;; Nobody else handles iso8601 correctly, lets do it ourselves. | 122 | ;; Nobody else handles iso8601 correctly, lets do it ourselves. |
| 123 | (when (string-match date-re date-string re-start) | 123 | (when (string-match date-re date-string re-start) |
| 124 | (setq year (string-to-int (match-string 1 date-string)) | 124 | (setq year (string-to-number (match-string 1 date-string)) |
| 125 | month (string-to-int (match-string 2 date-string)) | 125 | month (string-to-number (match-string 2 date-string)) |
| 126 | day (string-to-int (match-string 3 date-string)) | 126 | day (string-to-number (match-string 3 date-string)) |
| 127 | re-start (match-end 0)) | 127 | re-start (match-end 0)) |
| 128 | (when (string-match time-re date-string re-start) | 128 | (when (string-match time-re date-string re-start) |
| 129 | (setq hour (string-to-int (match-string 1 date-string)) | 129 | (setq hour (string-to-number (match-string 1 date-string)) |
| 130 | minute (string-to-int (match-string 2 date-string)) | 130 | minute (string-to-number (match-string 2 date-string)) |
| 131 | seconds (string-to-int (match-string 3 date-string)) | 131 | seconds (string-to-number (match-string 3 date-string)) |
| 132 | fractional-seconds (string-to-int (or | 132 | fractional-seconds (string-to-number (or |
| 133 | (match-string 4 date-string) | 133 | (match-string 4 date-string) |
| 134 | "0")) | 134 | "0")) |
| 135 | re-start (match-end 0)) | 135 | re-start (match-end 0)) |
| 136 | (when (string-match tz-re date-string re-start) | 136 | (when (string-match tz-re date-string re-start) |
| 137 | (setq tz (match-string 1 date-string))) | 137 | (setq tz (match-string 1 date-string))) |
| @@ -149,7 +149,7 @@ | |||
| 149 | time)) | 149 | time)) |
| 150 | 150 | ||
| 151 | (defun url-dav-process-boolean-property (node) | 151 | (defun url-dav-process-boolean-property (node) |
| 152 | (/= 0 (string-to-int (url-dav-node-text node)))) | 152 | (/= 0 (string-to-number (url-dav-node-text node)))) |
| 153 | 153 | ||
| 154 | (defun url-dav-process-uri-property (node) | 154 | (defun url-dav-process-uri-property (node) |
| 155 | ;; Returns a parsed representation of the URL... | 155 | ;; Returns a parsed representation of the URL... |
| @@ -318,7 +318,7 @@ | |||
| 318 | ;; only care about the numeric status code. | 318 | ;; only care about the numeric status code. |
| 319 | (let ((status (url-dav-node-text node))) | 319 | (let ((status (url-dav-node-text node))) |
| 320 | (if (string-match "\\`[ \r\t\n]*HTTP/[0-9.]+ \\([0-9]+\\)" status) | 320 | (if (string-match "\\`[ \r\t\n]*HTTP/[0-9.]+ \\([0-9]+\\)" status) |
| 321 | (string-to-int (match-string 1 status)) | 321 | (string-to-number (match-string 1 status)) |
| 322 | 500))) | 322 | 500))) |
| 323 | 323 | ||
| 324 | (defun url-dav-process-DAV:propstat (node) | 324 | (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." | |||
| 827 | 'text-cursor | 827 | 'text-cursor |
| 828 | 'cursor) | 828 | 'cursor) |
| 829 | 'invisible t)) | 829 | 'invisible t)) |
| 830 | (setq url-http-chunked-length (string-to-int (buffer-substring | 830 | (setq url-http-chunked-length (string-to-number (buffer-substring |
| 831 | (match-beginning 1) | 831 | (match-beginning 1) |
| 832 | (match-end 1)) | 832 | (match-end 1)) |
| 833 | 16) | 833 | 16) |
| 834 | url-http-chunked-counter (1+ url-http-chunked-counter) | 834 | url-http-chunked-counter (1+ url-http-chunked-counter) |
| 835 | url-http-chunked-start (set-marker | 835 | url-http-chunked-start (set-marker |
| 836 | (or url-http-chunked-start | 836 | (or url-http-chunked-start |
| @@ -904,7 +904,7 @@ the end of the document." | |||
| 904 | url-http-content-type (mail-fetch-field "content-type")) | 904 | url-http-content-type (mail-fetch-field "content-type")) |
| 905 | (if (mail-fetch-field "content-length") | 905 | (if (mail-fetch-field "content-length") |
| 906 | (setq url-http-content-length | 906 | (setq url-http-content-length |
| 907 | (string-to-int (mail-fetch-field "content-length")))) | 907 | (string-to-number (mail-fetch-field "content-length")))) |
| 908 | (widen))) | 908 | (widen))) |
| 909 | (if url-http-transfer-encoding | 909 | (if url-http-transfer-encoding |
| 910 | (setq url-http-transfer-encoding | 910 | (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 @@ | |||
| 51 | (if (or (/= (length netc) (length ipc)) | 51 | (if (or (/= (length netc) (length ipc)) |
| 52 | (/= (length ipc) (length maskc))) | 52 | (/= (length ipc) (length maskc))) |
| 53 | nil | 53 | nil |
| 54 | (setq netc (mapcar 'string-to-int netc) | 54 | (setq netc (mapcar 'string-to-number netc) |
| 55 | ipc (mapcar 'string-to-int ipc) | 55 | ipc (mapcar 'string-to-number ipc) |
| 56 | maskc (mapcar 'string-to-int maskc)) | 56 | maskc (mapcar 'string-to-number maskc)) |
| 57 | (and | 57 | (and |
| 58 | (= (logand (nth 0 netc) (nth 0 maskc)) | 58 | (= (logand (nth 0 netc) (nth 0 maskc)) |
| 59 | (logand (nth 0 ipc) (nth 0 maskc))) | 59 | (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: | |||
| 167 | (setq pass (match-string 2 user) | 167 | (setq pass (match-string 2 user) |
| 168 | user (match-string 1 user))) | 168 | user (match-string 1 user))) |
| 169 | (if (string-match ":\\([0-9+]+\\)" host) | 169 | (if (string-match ":\\([0-9+]+\\)" host) |
| 170 | (setq port (string-to-int (match-string 1 host)) | 170 | (setq port (string-to-number (match-string 1 host)) |
| 171 | host (substring host 0 (match-beginning 0)))) | 171 | host (substring host 0 (match-beginning 0)))) |
| 172 | (if (string-match ":$" host) | 172 | (if (string-match ":$" host) |
| 173 | (setq host (substring host 0 (match-beginning 0)))) | 173 | (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." | |||
| 196 | (year nil) | 196 | (year nil) |
| 197 | (month (car | 197 | (month (car |
| 198 | (rassoc | 198 | (rassoc |
| 199 | (string-to-int (aref parsed 1)) url-monthabbrev-alist))) | 199 | (string-to-number (aref parsed 1)) url-monthabbrev-alist))) |
| 200 | ) | 200 | ) |
| 201 | (setq day (or (car-safe (rassoc day url-weekday-alist)) | 201 | (setq day (or (car-safe (rassoc day url-weekday-alist)) |
| 202 | (substring raw 0 3)) | 202 | (substring raw 0 3)) |