home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / vmsnet / sources / 316 next >
Encoding:
Internet Message Format  |  1992-08-25  |  6.3 KB

  1. Path: sparky!uunet!usc!sdd.hp.com!network.ucsd.edu!mvb.saic.com!vmsnet-sources
  2. From: munroe@dmc.com (Dick Munroe)
  3. Newsgroups: vmsnet.sources
  4. Subject: SDLGCC patch 2: pointer to functions now generated properly, part 01/01
  5. Message-ID: <7917653@MVB.SAIC.COM>
  6. Date: Wed, 26 Aug 1992 02:20:05 GMT
  7. Organization: Doyle, Munroe Consultants, Inc., Hudson, MA
  8. Lines: 175
  9. Approved: Mark.Berryman@Mvb.Saic.Com
  10.  
  11. Submitted-by: munroe@dmc.com (Dick Munroe)
  12. Posting-number: Volume 3, Issue 122
  13. Archive-name: sdlgcc/patch2_01
  14. Patch-to: sdlgcc: Volume 3, Issue 102-103,108
  15.  
  16. This patch to SDLGCC corrects a bug which prevented pointers to functions in
  17. structures from being properly generated.  There remains a bug in handling
  18. general address constructs, but I'll fix that one when I need it.  Apply all
  19. previous patches before applying this one.
  20.  
  21. Good Luck.
  22.  
  23. Dick Munroe
  24. Doyle, Munroe Consultants, Inc.
  25. 267 Cox St.
  26. Hudson, Ma. 01749
  27. (508) 568-1618
  28. (FAX) (508) 562-1133
  29. munroe@dmc.com
  30.  
  31. $! ------------------ CUT HERE -----------------------
  32. $ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
  33. $!
  34. $! This archive created by VMS_SHARE Version 7.2-010  25-Jun-1992
  35. $!   On 25-AUG-1992 19:14:08.93   By user BERRYMAN 
  36. $!
  37. $! This VMS_SHARE Written by:
  38. $!    Andy Harper, Kings College London UK
  39. $!
  40. $! Acknowledgements to:
  41. $!    James Gray       - Original VMS_SHARE
  42. $!    Michael Bednarek - Original Concept and implementation
  43. $!
  44. $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
  45. $! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
  46. $!
  47. $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
  48. $!       1. PATCH2.DIFF;1
  49. $!
  50. $set="set"
  51. $set symbol/scope=(nolocal,noglobal)
  52. $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
  53. $e="write sys$error  ""%UNPACK"", "
  54. $w="write sys$output ""%UNPACK"", "
  55. $ if f$trnlnm("SHARE_LOG") then $ w = "!"
  56. $ ve=f$getsyi("version")
  57. $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
  58. $ e "-E-OLDVER, Must run at least VMS 4.4"
  59. $ v=f$verify(v)
  60. $ exit 44
  61. $UNPACK: SUBROUTINE ! P1=filename, P2=checksum
  62. $ x = P1 - f$parse(P1,,,"version")
  63. $ y = f$search(x)
  64. $ if y .eqs. "" then $ goto file_absent
  65. $ x = f$integer(f$parse(P1,,,"version")-";")
  66. $ y = f$integer(f$parse(y,,,"version")-";")
  67. $ if x .gt. y then $ goto file_absent
  68. $ if f$mode() .eqs. "INTERACTIVE" then $ goto file_interactive
  69. $ if x .eq. y then e "-W-EXISTS, File ''P1' exists. Skipped."
  70. $ if x .ne. y then e "-W-NEWERVERSION, of File ''P1' exists. Skipped."
  71. $file_delete:
  72. $ delete 'f'*
  73. $ exit
  74. $file_interactive:
  75. $ if x .eq. y then e "-W-EXISTS, File ''P1' exists."
  76. $ if x .ne. y then e "-W-NEWERVERSION, of File ''P1' exists."
  77. $ read/error=file_delete/end=file_delete-
  78.   /prompt="Create new version [y/n]: " -
  79.   sys$command x
  80. $ if .not. x then $ e "-W-SKIPPED, File ''P1' skipped."
  81. $ if .not. x then $ goto file_delete
  82. $ P1 = P1 - f$parse(P1,,,"version")
  83. $file_absent:
  84. $ if f$parse(P1) .nes. "" then $ goto dirok
  85. $ dn=f$parse(P1,,,"DIRECTORY")
  86. $ w "-I-CREDIR, Creating directory ''dn'."
  87. $ create/dir 'dn'
  88. $ if $status then $ goto dirok
  89. $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
  90. $ delete 'f'*
  91. $ exit
  92. $dirok:
  93. $ w "-I-PROCESS, Processing file ''P1'."
  94. $ if .not. f$verify() then $ define/user sys$output nl:
  95. $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
  96. PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
  97. SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
  98. CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
  99. LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
  100. BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
  101. IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
  102. MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
  103. ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
  104. 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
  105. POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
  106. ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
  107. COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
  108. "output_file"));ENDPROCEDURE;Unpacker;QUIT;
  109. $ delete/nolog 'f'*
  110. $ CHECKSUM 'P1'
  111. $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
  112. $ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
  113. $ ENDSUBROUTINE
  114. $START:
  115. $ create 'f'
  116. X*** `5B-.ref-lib`5Dsdlgcc.c
  117. X--- sdlgcc.c
  118. X**************
  119. X*** 11,16
  120. X  ** and unions but are parsable by GCC.
  121. X  **
  122. X  **
  123. X  ** 06-Aug-92 Dick Munroe
  124. X  **`09  Fix a bug in the IFDEF generation.
  125. X  **`09  Found a bug in the generation of arrays of structures.
  126. X--- 11,21 -----
  127. X  ** and unions but are parsable by GCC.
  128. X  **
  129. X  **
  130. X+ ** 14-Aug-92 Dick Munroe
  131. X+ **`09  Found a bug in the generation of items that are pointers to functio
  132. Vns.
  133. X+ **`09  The enclosing ()s are missing to override the default operator
  134. X+ **`09  precedence.
  135. X+ **`09 `20
  136. X  ** 06-Aug-92 Dick Munroe
  137. X  **`09  Fix a bug in the IFDEF generation.
  138. X  **`09  Found a bug in the generation of arrays of structures.
  139. X**************
  140. X*** 682,688
  141. X        `7B
  142. X  `09addressPN = resolveAddress(node->typeinfo2) ;
  143. X  `09print_predatatype(addressPN,level);
  144. X! `09column += fprintf(outfile, "*") ;
  145. X        `7D
  146. X        else
  147. X        `7B
  148. X--- 687,700 -----
  149. X        `7B
  150. X  `09addressPN = resolveAddress(node->typeinfo2) ;
  151. X  `09print_predatatype(addressPN,level);
  152. X! `09if (addressPN->type == SDL$C_NODE_ENTRY)
  153. X! `09`7B
  154. X! `09  column += fprintf(outfile,"(*") ;
  155. X! `09`7D`09`09`09`09`09`09/* End if (addressPN->type == SDL$C_NODE_ENTRY)`09
  156. V`09`09`09*/
  157. X! `09else
  158. X! `09`7B
  159. X! `09  column += fprintf(outfile, "*") ;
  160. X! `09`7D
  161. X        `7D
  162. X        else
  163. X        `7B
  164. X**************
  165. X*** 692,698
  166. X        print_postdatatype(node);
  167. X        if (addressPN->type == SDL$C_NODE_ENTRY)
  168. X        `7B
  169. X! `09column += fprintf(outfile,"(...)") ;
  170. X        `7D ;`09`09`09`09`09`09/* End if (addressPN->type == SDL$C_NODE_ENTR
  171. VY)`09`09`09`09*/
  172. X        column += fprintf(outfile,";");
  173. X        print_comment(node);
  174. X--- 704,710 -----
  175. X        print_postdatatype(node);
  176. X        if (addressPN->type == SDL$C_NODE_ENTRY)
  177. X        `7B
  178. X! `09column += fprintf(outfile,")(...)") ;
  179. X        `7D ;`09`09`09`09`09`09/* End if (addressPN->type == SDL$C_NODE_ENTR
  180. VY)`09`09`09`09*/
  181. X        column += fprintf(outfile,";");
  182. X        print_comment(node);
  183. $ CALL UNPACK PATCH2.DIFF;1 1898577155
  184. $ v=f$verify(v)
  185. $ EXIT
  186.