浏览代码

Revert "Fix CopyFile/FileCopy discrepancy between [Code] and ISPP.", except for the improved description. It's actually [Code]'s FileCopy which should be renamed instead of ISPP's CopyFile.

Martijn Laan 1 年之前
父节点
当前提交
445223b98a
共有 4 个文件被更改,包括 9 次插入17 次删除
  1. 3 7
      Files/ISPPBuiltins.iss
  2. 3 3
      ISHelp/ispp.xml
  3. 2 2
      Projects/Src/ISPP.Funcs.pas
  4. 1 5
      whatsnew.htm

+ 3 - 7
Files/ISPPBuiltins.iss

@@ -302,21 +302,17 @@
 #define SameStr(str S1, str S2) \
   S1 == S2
 
-#define WarnRenamed(str OldName, str NewName) \
+#define WarnRenamedVersion(str OldName, str NewName) \
   Warning("Function """ + OldName + """ has been renamed. Use """ + NewName + """ instead.")
 
 #define ParseVersion(str FileName, *Major, *Minor, *Rev, *Build) \
-  WarnRenamed("ParseVersion", "GetVersionComponents"), \
+  WarnRenamedVersion("ParseVersion", "GetVersionComponents"), \
   GetVersionComponents(FileName, Major, Minor, Rev, Build)
 
 #define GetFileVersion(str FileName) \
-  WarnRenamed("GetFileVersion", "GetVersionNumbersString"), \
+  WarnRenamedVersion("GetFileVersion", "GetVersionNumbersString"), \
   GetVersionNumbersString(FileName)
 
-#define CopyFile(str ExistingFile, str NewFile) \
-  WarnRenamed("CopyFile", "FileCopy"), \
-  FileCopy(ExistingFile, NewFile)
-
 #ifdef DisablePOptP
 # pragma parseroption -p-
 #endif

+ 3 - 3
ISHelp/ispp.xml

@@ -1000,10 +1000,10 @@ The first group of options (<tt>option</tt>) controls the general options, while
 					<p>Deletes the specified file. Does not return anything. Also see <tt><link href="DeleteFile">DeleteFile</link></tt>.</p>
 				</description>
 			</topic>
-			<topic id="FileCopy">
-				<title>FileCopy</title>
+			<topic id="CopyFile">
+				<title>CopyFile</title>
 				<section title="Prototype">
-					<pre><line><b>void</b> FileCopy(<b>str</b> ExistingFile, <b>str</b> NewFile)</line></pre>
+					<pre><line><b>void</b> CopyFile(<b>str</b> ExistingFile, <b>str</b> NewFile)</line></pre>
 				</section>
 				<description>
 					<p>Copies ExistingFile to NewFile, preserving time stamp and file attributes. If NewFile already exists, it will be overwritten.</p>

+ 2 - 2
Projects/Src/ISPP.Funcs.pas

@@ -1147,7 +1147,7 @@ begin
   end;
 end;
 
-function FileCopyFunc(Ext: Longint; const Params: IIsppFuncParams;
+function CopyFileFunc(Ext: Longint; const Params: IIsppFuncParams;
   const FuncResult: IIsppFuncResult): TIsppFuncResult; stdcall;
 begin
   if CheckParams(Params, [evStr, evStr], 2, Result) then
@@ -2045,7 +2045,7 @@ begin
     RegisterFunction('GetEnv', GetEnvFunc, -1);
     RegisterFunction('DeleteFile', DelFileFunc, -1);
     RegisterFunction('DeleteFileNow', DelFileNowFunc, -1);
-    RegisterFunction('FileCopy', FileCopyFunc, -1);
+    RegisterFunction('CopyFile', CopyFileFunc, -1);
     RegisterFunction('ReadEnv', GetEnvFunc, -1);
     RegisterFunction('FindFirst', FindFirstFunc, -1);
     RegisterFunction('FindNext', FindNextFunc, -1);

+ 1 - 5
whatsnew.htm

@@ -89,11 +89,7 @@ For conditions of distribution and use, see <a href="files/is/license.txt">LICEN
     <li>Documented support functions <tt>VarArrayGet</tt> and <tt>VarArraySet</tt> which were already available but not documented.</li>
   </ul>
   </li>
-  <li>ISPP changes:
-    <ul>
-      <li>Added support functions <tt>GetSHA256OfFile</tt>, <tt>GetSHA256OfString</tt>, and <tt>GetSHA256OfUnicodeString</tt>.</li>
-      <li>Support function <tt>CopyFile</tt> has been renamed to <tt>FileCopy</tt>. The old name is still supported, but it is recommended to update your scripts to the new name and the compiler will issue a warning if you don't.</li>
-    </ul>
+  <li>ISPP change: Added support functions <tt>GetSHA256OfFile</tt>, <tt>GetSHA256OfString</tt>, and <tt>GetSHA256OfUnicodeString</tt>.</li>
   <li>Various tweaks and other documentation improvements.</li>
 </ul>