mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 10:39:53 +01:00 
			
		
		
		
	codetools: c paresers: implemented function with return type pointer
git-svn-id: trunk@15917 -
This commit is contained in:
		
							parent
							
								
									aad576fab2
								
							
						
					
					
						commit
						cb341f3456
					
				@ -905,8 +905,11 @@ procedure TCCodeParserTool.ReadVariable(AsParameter: boolean);
 | 
			
		||||
        return memcmp(ba1, ba2, sizeof(bdaddr_t));
 | 
			
		||||
  }
 | 
			
		||||
  bdaddr_t *strtoba(const char *str);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
*)
 | 
			
		||||
{
 | 
			
		||||
  const char* (*item_name)(void* ctx);
 | 
			
		||||
  int (*fp)(char*); // pointer to function taking a char* argument; returns an int
 | 
			
		||||
  int * f(char*); // function taking a char* argument; returns a pointer to int
 | 
			
		||||
 | 
			
		||||
@ -976,6 +979,10 @@ begin
 | 
			
		||||
 | 
			
		||||
  // read name
 | 
			
		||||
  ReadNextAtom;
 | 
			
		||||
  while AtomIsChar('*') or AtomIs('const') do begin
 | 
			
		||||
    // pointer or const
 | 
			
		||||
    ReadNextAtom;
 | 
			
		||||
  end;
 | 
			
		||||
  if AtomIs('operator') then begin
 | 
			
		||||
    if AsParameter then
 | 
			
		||||
      RaiseException('operator not allowed as parameter');
 | 
			
		||||
@ -1012,11 +1019,6 @@ begin
 | 
			
		||||
    if not AtomIsChar(')') then
 | 
			
		||||
      RaiseExpectedButAtomFound(')');
 | 
			
		||||
  end else begin
 | 
			
		||||
    while AtomIsChar('*') or AtomIs('const') do begin
 | 
			
		||||
      // pointer or const
 | 
			
		||||
      ReadNextAtom;
 | 
			
		||||
    end;
 | 
			
		||||
 | 
			
		||||
    {$IFDEF VerboseCCodeParser}
 | 
			
		||||
    DebugLn(['TCCodeParserTool.ReadVariable name=',GetAtom]);
 | 
			
		||||
    {$ENDIF}
 | 
			
		||||
@ -2047,7 +2049,6 @@ begin
 | 
			
		||||
      exit;
 | 
			
		||||
  end;
 | 
			
		||||
  Result:=IfNDefNode;
 | 
			
		||||
  DebugLn(['TCCodeParserTool.FindEnclosingIFNDEF ']);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function TCCodeParserTool.GetAtom: string;
 | 
			
		||||
 | 
			
		||||
@ -166,6 +166,8 @@ static inline int bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2)
 | 
			
		||||
typedef unsigned short sa_family_t;
 | 
			
		||||
int hci_inquiry(int dev_id, int len, int num_rsp, const uint8_t *lap, inquiry_info **ii, long flags);
 | 
			
		||||
 | 
			
		||||
const char* (*item_name)(void* ctx);
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user