Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
CnWizards IDE Wizards
» 函数列表“Match All Parts”在10.4不对
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: 函数列表“Match All Parts”在10.4不对
hq200306
灌水科科长
UID 67758
Digest Posts 0
Credits 106
Posts 36
点点分 106
Reading Access 10
Registered 2012-12-1
Status Offline
#1
Post at 2020-5-29 22:07
Profile
|
Blog
|
P.M.
函数列表“Match All Parts”在10.4不对
我从github下了最新的cnpack,编译安装在10.4,发现函数列表“Match All Parts”在10.4不对,只能匹配一个字符,但10.3的正确
Image Attachment
:
函数过程列表.png
(2020-5-29 22:07, 106.66 K)
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#2
Post at 2020-6-2 11:32
Profile
|
Blog
|
P.M.
已修正,下一每日构建版鸡翅。
原因是10.4的编译器对PChar与Char形式的转换做了限制,导致行为改变了,详情如下:
假设有一个函数,用PWideChar类型的参数来实际传递一个WideChar,(嫑笑,好多个Windows API就是这么设计的):
function Test(C: PWideChar): WideChar;
begin
Result := WideChar(C);
end;
假设如此调用:
var
C: WideChar;
begin
C := 'a';
C := Test(PWideChar(C));
10.3或以下版本,C仍然得到'a'。但10.4版里,C就得到一个乱码。
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#3
Post at 2020-6-2 11:33
Profile
|
Blog
|
P.M.
鸡翅->集成。
hq200306
灌水科科长
UID 67758
Digest Posts 0
Credits 106
Posts 36
点点分 106
Reading Access 10
Registered 2012-12-1
Status Offline
#4
Post at 2020-6-2 16:38
Profile
|
Blog
|
P.M.
试了,现在可以了
hq200306
灌水科科长
UID 67758
Digest Posts 0
Credits 106
Posts 36
点点分 106
Reading Access 10
Registered 2012-12-1
Status Offline
#5
Post at 2020-6-2 16:43
Profile
|
Blog
|
P.M.
//pascal
function Test(C: PWideChar): WideChar;
begin
Result := C^;
end;
//
var
C: WideChar;
begin
C := 'a';
C := Test(@c);
[
本帖最后由 hq200306 于 2020-6-2 16:51 编辑
]
hq200306
灌水科科长
UID 67758
Digest Posts 0
Credits 106
Posts 36
点点分 106
Reading Access 10
Registered 2012-12-1
Status Offline
#6
Post at 2020-6-2 16:56
Profile
|
Blog
|
P.M.
我对比了下10.4,10.3的汇编,10.4编译器将“a”转成字符串,再调用,区别太大了
var
C: WideChar;
begin
C := 'a';
C := Test(PWideChar(C));
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-21 20:37
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.008984 second(s), 8 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats