From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 01 22:20:17 2022 Received: (at submit) by debbugs.gnu.org; 2 Dec 2022 03:20:17 +0000 Received: from localhost ([127.0.0.1]:43591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0wb2-0005Gm-Ig for submit@debbugs.gnu.org; Thu, 01 Dec 2022 22:20:17 -0500 Received: from lists.gnu.org ([209.51.188.17]:37610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0wb0-0005Gg-Kv for submit@debbugs.gnu.org; Thu, 01 Dec 2022 22:20:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p0wb0-0000Dj-FF for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 22:20:14 -0500 Received: from sonic301-30.consmr.mail.ne1.yahoo.com ([66.163.184.199]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0way-0006b0-8x for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 22:20:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1669951210; bh=byD7uP7Bg2j+BUme/EhLDGzH6kuY08zEQp9zXKMCSAA=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=kyeMfAlHZI6E//WfWx0TRHXoDTZHtc3OHji9egOtnghmgJoXaNHeDR8odX/Gli3VI5BDD5ifov7HE3cbripr6UIbRf1mJxTDhI2Cz3SsmQgX7yMb0rrADleqpcxe71pXN0ZcHmZyvemKEg/u/p57lA+a8sPoldqBWbKm0JptVvVBGB1+Wqj414USh+H5ZYMNjq0OrWmHIpTBz5UGnIpwGp/mCYget96VJQXmT/jJB2+V64Giay4+POuMoL9jJp2YCzvkCyuVICq6hLggncB8zzT8URnWspB2uHmKsXvFOP/xt+7Bk/Ialw0713oxSOLU//Nxf0ptow2wuuXjDzcOgA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1669951210; bh=kOw6eG1vU7932V/xa+4o255J0lfoyGTOje+SzFojq8m=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=dG41aO0dyA0wf/0lqEU+GyLRJ9CdQXYfdulPCnmRzRJ/+QH7lOd+ztJh/3GYa2zkU/5oX3vKQmCm5IhZv7q2zxzDvTGf1YIiinYw2mrTu6fGWAnqXyBBEZRy1/REwBkySUfyn+tbPhGT/Gi1l1/z1QJRbpYN9xGIZGBMU56Q1Jz8lcNo0qPmTfuMQK6C9bqsHvdvqRpVRyPqo60rybkf8dPQR4OmBfwnWVw91h36u38KmwlJCOTeF7NZFhPslPEQ0obg11lg/+zMuABribjEViK+B/kk9K5Xyrdj7MZ/Lwt1B7O64UTC4B4aAkp2hDo4D/4kaUY7DthkAKgRX/Imgg== X-YMail-OSG: hrHW7AgVM1m6Cs22iUyzQJtulVQ0ffEJsZqzhmf.GDgLKPAZemBglcgsxFq5G29 D5XDh_FAiCWwDKIxwkT5TOemUGV7jMbG6yUz1sdpWDuiw4xUjHgkmRdlgviyVsr2coj_WNSVf3gi SRJvE23j3W02JwwhzyBefeLqh11KP1kIuxWbjUFo.yWnBSvJQLy2Lji5s8WMUoV1pY1rN1h33w50 706rfqXczP.XB.18WEco6se72Lg6a0_lHTfrMDI6dcZiu9YUGao2noxVL3ecDClrYPG1gk_YMO_A 0c5M7weRzBOaLaIOkkE4KnQfi1egwmbzBF0SOIoMZH9vUr4C6UD62W4cJ_VNy_yUIkpblXnETLJo Wtz5h.ygXSc5HdHOVsRHyeOJXxt.CE0Dh2RcCQ.8o9_oNc5SP4Q4Zlic70VWFuExD2eC0Ko5HMir CferTF2IQ_7onR8R5w3_P2CchNduXlsBmHEFbr0JdofePKZawaOQyf1DuTJoWm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w2rq07.2F uo2fuQI7cBdF57ilS8Bz_dWNnTsKoUB_i_rU_hBNe22UY7FuU8PV_Ou4jkYJ72_L57cRnoh4wSSZ rjiG8Y9rTGni8CZaZfj1eQ3rmg.5fxNoUchT3QSUPpplJ3pobWruU8tbeaqnTovxfvFoZzOYUw8r 4Me7o3_ZkC6QUaE2.lRrn0R356OIcd44WcBdPM65tmK6H1CFcFVYtoiNfactxTFq7VKHUn1c7M3X 89b81Upm8b9wEWQe5sPqfXxj.ufz56yEQm61JdlHszv3s6YhpyiS8k_BwYXMeQ_o15cA9PdWvYdD admaTegfXLLdDEGb1Vt24DxIHuMVFM3wzxJTSnHGwbUbzp7PmlAQnf60FjjtUElmpa4MjOCP6ClQ Oj1Iau.AMUK.UUcpVswJwKxOwALfGpZM6k1KqeD.qs.uH0hdy7zHjQOnIYn4bvsXIAZe5R4vo.oL aUoknIc8SCnk.9Ub.kHbDn1q7ZNBgS21LjJd1B.D6Z5Gu1jslJtKMnhC19mjUOK6PFV9W1qVX.ti 65DW7hMT71VRZakusFMOs2d88K71zC0KFi1uAZ1yi8DhPpFKrZeZ1TGRyNRrF.8xiHSeoCzKaBn7 ..ybBIkbcs969WT4XYcX0c5iARXqBNHF99S6EF.5wxCsvP1hJQeVXNdslYD_4eIVrXKjAYOiHxDo KEUix5vKSYINiB7789I2VAQw4gEpil3qdC5Wc7X8SjADVO40T X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Fri, 2 Dec 2022 03:20:10 +0000 Received: by hermes--production-sg3-b666c6484-2ttjv (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 4f75852e28573254775f08a3b9774050; Fri, 02 Dec 2022 03:20:07 +0000 (UTC) From: Po Lu To: bug-gnu-emacs@gnu.org Subject: CC Mode 5.35.2 (C/*l); Incorrect fontification of `xid' as type X-Debbugs-Package: cc-mode Date: Fri, 02 Dec 2022 11:20:01 +0800 Message-ID: <87iliusd9a.fsf@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable References: <87iliusd9a.fsf.ref@yahoo.com> X-Mailer: WebService/1.1.20926 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 6995 Received-SPF: pass client-ip=66.163.184.199; envelope-from=luangruo@yahoo.com; helo=sonic301-30.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.6 (-) Package: cc-mode Insert the following file in a C mode buffer: /* idalloc.c - client resource management. */ #include #include "idalloc.h" /* Array of all resource tables. */ struct resource_table *resource_tables[MAX_TABLE_ID]; /* Find a single unused resource table ID. Return (card16) -1 upon failure. */ static card16 get_free_id (void) { card16 i; for (i =3D 0; i <=3D MAX_TABLE_ID; ++i) { if (!resource_tables[i]) return i; } return (card16) -1; } /* Create a resource table for the server or for a new client. Return NULL if the table could not be allocated. */ struct resource_table * get_resource_table (void) { struct resource_table *table; card16 id; id =3D find_free_id (); if (id =3D=3D (card16) -1) return NULL; table =3D server_malloc (sizeof *table); if (!table) return; table->id =3D id; table->resource_map =3D gl_map_nx_create_empty (GL_HASH_MAP, NULL, NULL, NULL, NULL); if (!table->resource_map) { server_free (table); return NULL; } resource_tables[table->id] =3D table; return table; } /* Look up a resource given the specified XID and type, and return it in RESOURCE. If CLIENT is specified, the lookup is being done on behalf of the specified client. Return the result of the lookup: L_SUCCESS - the lookup was successful. L_WRONGTYPE - the resource was found, but it is the wrong type. L_ACCESS - the resource was found, but cannot be accessed. L_ERROR - the resource was not found. The upper 10 bits of the XID provide the index into the resource table, and the lower 19 bits are used as the key to the hash table. Any resource found is returned in RESOURCE, which is otherwise set to NULL. */ enum lookup_result id_lookup (xid xid, enum resource_type type, struct client *client, struct resource **resource) { card16 table_id; struct resource_table *table; *resource =3D NULL; table_id =3D (xid >> (29 - TABLE_ID_BITS) & MAX_TABLE_ID); table =3D resource_tables[table_id]; if (!table) return L_ERROR; return id_lookup_1 (xid, type, client, resource); } enum lookup_result id_lookup_1 (xid xid, struct resource_table *resource_table, enum resource_type type, struct client *client, struct resource **resource) { void *value; *resource =3D NULL; if (!gl_map_search (resource_table->map, (intptr_t) (xid & TABLE_RESOURCE_MASK), &value)) return; } and scroll to the very end. In "id_lookup_1", every occurrence of "xid" will be fontified as a type!. Emacs : GNU Emacs 39.0.60 (build 7, x86_64-pc-linux-gnu) of 2022-12-02 Package: CC Mode 5.35.2 (C/*l) Buffer Style: gnu c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-st= ring-delim gen-comment-delim syntax-properties category-properties 1-bit) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq c-basic-offset 2 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . = 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "" c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+") (= other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode = . gtkdoc) (c++-mode . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((substatement-open before after) (arglist-cont-no= nempty)) c-hanging-colons-alist nil c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) c-backslash-column 48 c-backslash-max-column 72 c-special-indent-hook '(t c-gnu-impose-minimum) c-label-minimum-indentation 1 c-offsets-alist '((inexpr-class . +) (inexpr-statement . +) (lambda-intro-cont . +) (inlambda . 0) (template-args-cont c-lineup-template-args +) (incomposition . +) (inmodule . +) (innamespace . +) (inextern-lang . +) (composition-close . 0) (module-close . 0) (namespace-close . 0) (extern-lang-close . 0) (composition-open . 0) (module-open . 0) (namespace-open . 0) (extern-lang-open . 0) (objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-= method-call +) (objc-method-args-cont . c-lineup-ObjC-method-args) (objc-method-intro . [0]) (friend . 0) (cpp-define-intro c-lineup-cpp-define +) (cpp-macro-cont . +) (cpp-macro . [0]) (inclass . +) (stream-op . c-lineup-streamop) (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist) (arglist-cont c-lineup-gcc-asm-reg 0) (comment-intro c-lineup-knr-region-comment c-lineup-comment) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (access-label . -) (case-label . 0) (substatement . +) (statement-case-intro . +) (statement . 0) (brace-entry-open . 0) (brace-list-entry . 0) (brace-list-close . 0) (block-close . 0) (block-open . 0) (inher-cont . c-lineup-multi-inher) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (annotation-var-cont . +) (annotation-top-cont . 0) (topmost-intro . 0) (knr-argdecl . 0) (func-decl-cont . +) (inline-close . 0) (class-close . 0) (class-open . 0) (defun-block-intro . +) (defun-close . 0) (defun-open . 0) (c . c-lineup-C-comments) (string . c-lineup-dont-change) (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEF= UN-intro-cont) (brace-list-intro first c-lineup-2nd-brace-entry-in-arglist c-lineup-c= lass-decl-init-+ +) (brace-list-open . +) (inline-open . 0) (arglist-close . c-lineup-arglist) (arglist-intro . c-lineup-arglist-intro-after-paren) (statement-cont . +) (statement-case-open . +) (label . 0) (substatement-label . 0) (substatement-open . +) (knr-argdecl-intro . 5) (statement-block-intro . +) ) c-buffer-is-cc-mode 'c-mode c-tab-always-indent t c-syntactic-indentation t c-syntactic-indentation-in-macros t c-ignore-auto-fill '(string cpp code) c-auto-align-backslashes t c-backspace-function 'backward-delete-char-untabify c-delete-function 'delete-char c-electric-pound-behavior nil c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu")) c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 8 comment-column 32 parse-sexp-ignore-comments t parse-sexp-lookup-properties t auto-fill-function nil comment-multi-line t comment-start-skip "\\(?://+\\|/\\*+\\)\\s *" fill-prefix nil fill-column 70 paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-=E2=80=93!|#%= ;>*=C2=B7=E2=80=A2=E2=80=A3=E2=81=83=E2=97=A6]+[ ]*\\)*\\)" )