history

来自「把pascal程序转成C语言程序 把pascal程序转成C语言程序」· 代码 · 共 825 行 · 第 1/3 页

TXT
825
字号
    SpaceCommas	       Use spaces after commas (default on).    SpaceFuncs	       Use spaces after function names (default off).    NoBanner	       Suppress "From input file..." comment at top of file.Version 1.18: * Improved indentation strategy for EMBED comments. * Allowed one-line EMBED comments: {EMBED foo();} * Made {SKIP} ... {NOSKIP} comments nestable.  ({NOSKIP ... } isn't nestable.) * Changed to emit comments in export sections of modules in correct order. * Rewrote decl.c:p_arraydecl slightly to avoid a gcc bug. * Bug fix in expr.c:makeexpr_sizeof: Compute size by hand if SkipIndices used.   Symptom: Size was "sizeof(arr)" even if it should have omitted skipped part. * Bug fix in trans.h: Added #undef _toupper/_tolower at end.   Symptom: Failed to compile on Apollos. * Bug fix in parse.c:fixblock: Added "sp->stm1 &&" check for WHILE statements.   Symptom: "while cond do ;" caused a reference-to-NULL error. * Bug fix in decl.c:makefakestruct: Suppressed fakestruct when importing.   Symptom: Importing a module generates two declarations for _REC_A. * Bug fix in Makefile: Added rules to make home dirs if not found.Version 1.17: * Introduced "StructFile" stuff to help with more intensive file operations. * Simplified "N + 0.0" to "(double)N" instead of "N" when appropriate. * Fixed typo in sys.p2crc: "LogBreakPenalty" => "RelBreakPenalty". * Changed to avoid generating bit fields as members of a union. * Now "stringarray[i] := expr" will sprintf expr into lhs with no temp var. * Handled assignment of small packed arrays of chars into big ones. * Added to sys.p2crc/trans.h the following configuration parameters:    CharConsts      Assume "const c='x'" is a char, not string constant.    SelfIncludeName Format to use when a module includes its own .h file.    StructFiles     Translate files as special structs rather than FILE *'s.    StructFile      A file variable to be treated as if StructFiles=1.Version 1.16: * Reduced wasteful proliferation of identical-looking temporary variables. * Improved heuristic for determining allocation size for set constructors. * Corrected handling for EOF applied to buffered binary files. * Bug fix in decl.c: Handled a rare case involving forward-declared pointers. * Bug fix in p2clib.c:P_remset: Forgot to fix s[0] if highest bit was cleared. * Bug fix in p2clib.c:P_setxor: Forgot to fix s[0] if highest bits cancelled. * Added to sys.p2crc/trans.h the following configuration parameters:    EofBufName      Macro to use for EOF of a bufffered file.    FilePosBufName  Macro to use for FILEPOS or POSITION of a buffered file.Version 1.15: * Taught the line breaker to handle logical/relational operators specially. * Improved code generation for large set constructors. * Changed makeexpr_assign to handle EK_LITCAST's on the lefthand side. * Changed makeexpr_addr to handle casts. * Changed FieldMacros so that the substituted base expr retains its type. * Bug fix in p2c.h: Rewrote P_getbits_US and other small-packed-array macros.   Symptom: On many architectures, these macros didn't work at all!   NOTE: These now pack small arrays in the opposite direction (LSB first). * Bug fix in funcs.c:handleread_text: changed strread of string to use %255s.   Symptom: Previous translation of %255c did not append a null character. * Bug fix in p2clib.c:strrtrim: Added test for empty string input.   Symptom: Incorrect behavior on strrtrim(""). * Bug fix in p2clib.c:P_addsetr: Changed to signed comparison of v1 and v2.   Symptom: Adding [0..-1] to a set failed. * Bug fix in p2clib.c:P_expset: Don't write to d[1] if set is empty.   Symptom: Sets allocated to store 0 elements didn't work properly. * Added to sys.p2crc/trans.h the following configuration parameters:    LogBreakPenalty         Like OpBreakPenalty, but for && and ||.    LogBreakExtraPenalty    Like OpBreakExtraPenalty, but for && and ||.    RelBreakPenalty         Like OpBreakPenalty, but for <, ==, etc.    RelBreakExtraPenalty    Like OpBreakExtraPenalty, but for <, ==, etc.Version 1.14: * Added partial support for Oregon Software Pascal's delete(f) procedure. * Changed file_iofunc to be a little more robust in case of errors. * Bug fix in p2clib.c:strrtrim: Changed to "while (*++s2) ;"   Symptom: This function didn't do anything! * Bug fix in decl.c:p_type: Declared enums which were base types of sets.   Symptom: In "type s = set of (a,b)", the enum was never declared. * Bug fix in decl.c:issafename: Avoided #defining existing field names.   Symptom: "type r=record a:integer; end; const a=10;" produced bad code. * Bug fix in expr.c:makeexpr_charcast: Changed to recognize CONST names.   Symptom: "const x='x'; var s : set of char; s := [x];" generated bad code.Version 1.13: * Changed to interpret cpp-style "#include" as another include-file syntax. * Improved handling of WRITE field widths for packed arrays of char. * Improved handling of built-in identifiers in PascalCaseSens mode. * Bug fix in parse.c:p_function: used strcicmp to check for "FORWARD" keyword.   Symptom: In PascalCaseSens mode, forward declarations had to be capitalized.Version 1.12: * Added support for Sun/Berkeley Pascal. * Beefed up PascalCaseSens handling. * Added some extra parentheses to the P_clrbits macros. (!) * Added to sys.p2crc/trans.h the following configuration parameters:    CharFileText    Treat "file of char" as identical to "text".    UseStrncmp	    Use strncmp, not memcmp, to compare packed arrays of char.    MessageStderr   Built-in "message(...)" should use stderr, not stdout.    LiteralFiles    Files opened without names should use file var's name.    LiteralFile	    Specific files which should use LiteralFiles=1 mode.Version 1.11: * Improved the "usage" message slightly. * Introduced "CollectNest=0" to help with include files of sub-procedures. * Changed to ignore "OVERLAY" keyword (a Turbo Pascal anachronism). * Introduced "BROKEN_OR" option in trans.h in case of compiler bugs. * Changed src/Makefile to check for presence of nroff before changing p2c.cat. * Taught strmax_func to understand string consts as well as string literals. * Changed system.imp to use __module to avoid ModuleNotation dependencies. * Prevented variables in varstructs from being declared "const". * Changed "checkvarchanged" in decl.c to observe constqual, volatilequal. * Introduced "expr_has_address" (in expr.c) as a variant on "expr_is_lvalue". * Bug fix in pexpr.c:p_funcarglist: for strings as conformant arrays, low=1.   Symptom: Strings were passed as array [0..N] instead of [1..N]. * Bug fix in decl.c:setupmeaning: added missing "break;" for MK_VARIANT case.   Symptom: Special formatting for enumerated type names was broken. * Bug fix in p2c.h:P_getcmdline: removed "Const" keywords.   Symptom: Prototype was inconsistent with definition in p2clib.c. * Bug fix in decl.c:addfield: changed to "tname && tname->name ? ...".   Symptom: Reference to NULL formatting field names for unnamed records. * Bug fix in expr.c:fixblock: fixed getfbuf + get => fread to check var type.   Symptom: "f:file of byte; i:integer; i:=f^; get(f);" used fread incorrectly. * Bug fix in lex.c:turbo_directive: checked return value of handle_include.   Symptom: Turbo-style include directives messed up if file was not found. * Added to sys.p2crc/trans.h the following configuration parameter:    CollectNest     Kludge to make sub-procs be emitted as they are parsed.Version 1.10: * Bug fix in comment.c:addnote: reference to "quiet" changed to "quietmode".   Symptom: Failed to compile!  (Sorry, about that!)Version 1.09: * Made a few improvements to "-R" (regression-testing) mode. * Bug fix in decl.c:addfield: rewrote part of the issafename loop.   Symptom: Various problems choosing names for fields of structs. * Bug fix in out.c:getcurtime: modified non-HASTIME case to use starttime.   Symptom: Not safe to multiply raw time() result by 1000.Version 1.08: * Changed "makeproto" commands in src/Makefile to "./makeproto". * Extended "ConstFormat" mechanism for all other kinds of identifiers. * Added a special format for Pascal include-file names. * Added "UseConsts=2" to force the use of "Const" instead of "const". * Added FileNameFilter option. * Added "-E" switch to halt after some number of errors. * Added DeclBufNCName for compilers which can't handle null macro arguments. * Handled the case of multiple parameters using a common conformant schema. * Incorporated several Oregon Pascal standard procedures from William Bader. * Fixed typo in documentation of "BraceLine" in sys.p2crc. * Bug fix: in funcs.c:handleread_text: add copyexpr to P_read[ln]paoc calls.   Symptom: Dangling pointer problems generating calls to P_read[ln]paoc. * Bug fix: in pexpr.c:dots_n_hats:TOK_LBR case: changed to use p_ord_expr().   Symptom: Arrays indexed by literal characters used "A", not 'A'. * Bug fix: in pexpr.c:p_setfactor: added two makeexpr_longcast calls.   Symptom: Generated code used "1 << x" instead of "1L << x" in a few places. * Bug fix: in decl.c:setup_decl: defined SWORD equivalent to tp_sshort.   Symptom: Signed words were translated as longs under some circumstances. * Bug fix: in parse.c:fixblock: "if" rearrangements now clear if-else flags.   Symptom: Else-ifs were formed in inappropriate places. * Bug fix: in parse.c:fixblock: "continue" added after final eatstmt call.   Symptom: Reference to an already-freed pointer. * Added to sys.p2crc/trans.h the following configuration parameters:    ModuleFormat    Analogous to ConstFormat but for module names.    FunctionFormat  Analogous to ConstFormat but for function names.    VarFormat       Analogous to ConstFormat but for variable names.    FieldFormat     Analogous to ConstFormat but for record field names.    TypeFormat      Analogous to ConstFormat but for type names.    EnumFormat      Analogous to ConstFormat, for enumeration constant names.    IncludeFileName Format for include file names.    FileNameFilter  Function to call to "clean" file names for use by fopen.    MaxErrors	    Number of errors/warnings/notes printed before aborting.    DeclBufNCName   Version of DeclBufName with no "storage class" arg.Version 1.07: * Added "Integer16=2" mode to translate Pascal "integer" as C "int". * Added a warning when "%" is used for MOD of arguments that may be negative. * Made formatted output of booleans and reals closer to Pascal standards. * Now print warning when trying to use associated buffers of file params. * Added support for buffered "file of array" types. * Prevented warning message when main program ends with ";" instead of ".".

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?