Skip to content

Commit

Permalink
[java] Remove Access parameter from fillReferenceItem()
Browse files Browse the repository at this point in the history
  • Loading branch information
thoni56 committed May 29, 2024
1 parent 11d511d commit a2f68b3
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 24 deletions.
7 changes: 3 additions & 4 deletions src/completion.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@ Completion *completionListPrepend(Completion *completions, char *name, char *ful
ss = olcxAlloc(slen+1);
strcpy(ss, referenceItem->linkName);
fillReferenceItem(&sri, ss, referenceItem->vApplClass, referenceItem->vFunClass,
referenceItem->type, referenceItem->storage, referenceItem->scope,
0, referenceItem->category);
referenceItem->type, referenceItem->storage, referenceItem->scope, referenceItem->category);

completion = newCompletion(name, fullName, 1, referenceItem->category, cType, *reference, sri);
} else if (symbol==NULL) {
Reference r = *reference;
r.next = NULL;
fillReferenceItem(&sri, "", NO_FILE_NUMBER, NO_FILE_NUMBER, TypeUnknown, StorageDefault,
ScopeAuto, 0, CategoryLocal);
ScopeAuto, CategoryLocal);
completion = newCompletion(name, fullName, 1, CategoryLocal, cType, r, sri);
} else {
Reference r;
Expand All @@ -83,7 +82,7 @@ Completion *completionListPrepend(Completion *completions, char *name, char *ful
fillReference(&r, r.usage, symbol->pos, NULL);
fillReferenceItem(&sri, ss,
vFunClass, vFunClass, symbol->type, storage,
scope, 0, category);
scope, category);
completion = newCompletion(name, fullName, 1, category, cType, r, sri);
}
if (fullName!=NULL) {
Expand Down
10 changes: 4 additions & 6 deletions src/cxfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ static void writeReferenceItem(ReferenceItem *referenceItem) {
fillReferenceItem(&lastOutgoingInfo.cachedReferenceItem[symbolIndex],
lastOutgoingInfo.cachedSymbolName[symbolIndex],
referenceItem->vApplClass, referenceItem->vFunClass, referenceItem->type,
referenceItem->storage, referenceItem->scope, 0,
referenceItem->storage, referenceItem->scope,
referenceItem->category);
lastOutgoingInfo.symbolTab[symbolIndex] = &lastOutgoingInfo.cachedReferenceItem[symbolIndex];
lastOutgoingInfo.symbolIsWritten[symbolIndex] = false;
Expand Down Expand Up @@ -791,15 +791,14 @@ static void scanFunction_SymbolNameForFullUpdateSchedule(int size,

ReferenceItem *referenceItem = &lastIncomingInfo.cachedReferenceItem[symbolIndex];
lastIncomingInfo.symbolTab[symbolIndex] = referenceItem;
fillReferenceItem(referenceItem, id, vApplClass, vFunClass, symbolType, storage, ScopeGlobal,
0, CategoryGlobal);
fillReferenceItem(referenceItem, id, vApplClass, vFunClass, symbolType, storage, ScopeGlobal, CategoryGlobal);
if (!isMemberInReferenceTable(referenceItem, NULL, &memb)) {
// TODO: This is more or less the body of a newReferenceItem()
char *ss = cxAlloc(len+1);
strcpy(ss,id);
memb = cxAlloc(sizeof(ReferenceItem));
fillReferenceItem(memb, ss, vApplClass, vFunClass, symbolType, storage,
ScopeGlobal, 0, CategoryGlobal);
ScopeGlobal, CategoryGlobal);
addToReferencesTable(memb);
}
lastIncomingInfo.symbolTab[symbolIndex] = memb;
Expand Down Expand Up @@ -868,8 +867,7 @@ static void scanFunction_SymbolName(int size,

referencesItem = &lastIncomingInfo.cachedReferenceItem[symbolIndex];
lastIncomingInfo.symbolTab[symbolIndex] = referencesItem;
fillReferenceItem(referencesItem, id, vApplClass, vFunClass, symbolType, storage, ScopeGlobal,
0, CategoryGlobal);
fillReferenceItem(referencesItem, id, vApplClass, vFunClass, symbolType, storage, ScopeGlobal, CategoryGlobal);
bool isMember = isMemberInReferenceTable(referencesItem, NULL, &member);
while (isMember && member->category!=CategoryGlobal)
isMember = refTabNextMember(referencesItem, &member);
Expand Down
8 changes: 3 additions & 5 deletions src/cxref.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ Reference *addNewCxReference(Symbol *symbol, Position *position, Usage usage,
ReferenceItem referenceItem;
ReferenceItem *foundMember;

fillReferenceItem(&referenceItem, symbol->linkName, vApplCl, vFunCl, symbol->type, storage, scope,
symbol->access, category);
fillReferenceItem(&referenceItem, symbol->linkName, vApplCl, vFunCl, symbol->type, storage, scope, category);
if (options.mode==ServerMode && options.serverOperation==OLO_TAG_SEARCH && options.searchKind==SEARCH_FULL) {
fillUsage(&reference.usage, usage.kind);
fillReference(&reference, reference.usage, *position, NULL);
Expand All @@ -278,7 +277,7 @@ Reference *addNewCxReference(Symbol *symbol, Position *position, Usage usage,
strcpy(linkName, symbol->linkName);
ReferenceItem *r = cxAlloc(sizeof(ReferenceItem));
fillReferenceItem(r, linkName, vApplCl, vFunCl, symbol->type,
storage, scope, 0, category);
storage, scope, category);
pushReferenceItem(r, index);
foundMember = r;
}
Expand Down Expand Up @@ -1167,8 +1166,7 @@ SymbolsMenu *olCreateSpecialMenuItem(char *fieldName, int cfi, Storage storage){
SymbolsMenu *res;
ReferenceItem ss;

fillReferenceItem(&ss, fieldName, cfi, cfi, TypeDefault, storage, ScopeGlobal,
0, CategoryGlobal);
fillReferenceItem(&ss, fieldName, cfi, cfi, TypeDefault, storage, ScopeGlobal, CategoryGlobal);
res = olCreateNewMenuItem(&ss, ss.vApplClass, ss.vFunClass, &noPosition, UsageNone,
1, 1, OOC_VIRT_SAME_APPL_FUN_CLASS,
UsageUsed, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ SymbolsMenu *olCreateNewMenuItem(ReferenceItem *symbol, int vApplClass, int vFun
allocatedNameCopy = olcxStringCopy(symbol->linkName);

fillReferenceItem(&refItem, allocatedNameCopy, vApplClass, vFunCl,
symbol->type, symbol->storage, symbol->scope, 0,
symbol->type, symbol->storage, symbol->scope,
symbol->category);

symbolsMenu = olcxAlloc(sizeof(SymbolsMenu));
Expand Down
2 changes: 1 addition & 1 deletion src/reference.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Reference *duplicateReference(Reference *original) {
}

void fillReferenceItem(ReferenceItem *referencesItem, char *name, int vApplClass,
int vFunClass, Type symType, Storage storage, ReferenceScope scope, Access accessFlags,
int vFunClass, Type symType, Storage storage, ReferenceScope scope,
ReferenceCategory category) {
referencesItem->linkName = name;
referencesItem->fileHash = cxFileHashNumber(name);
Expand Down
3 changes: 1 addition & 2 deletions src/reference.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ typedef struct referenceItem {

extern void fillReference(Reference *reference, Usage usage, Position position, Reference *next);
extern void fillReferenceItem(ReferenceItem *referencesItem, char *name, int vApplClass,
int vFunClass, Type symType, Storage storage, ReferenceScope scope,
Access accessFlags, ReferenceCategory category);
int vFunClass, Type symType, Storage storage, ReferenceScope scope, ReferenceCategory category);
extern Reference *duplicateReference(Reference *r);
extern void freeReferences(Reference *references);
extern void resetReferenceUsage(Reference *reference, UsageKind usageKind);
Expand Down
2 changes: 1 addition & 1 deletion src/reference.mock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void fillReference(Reference *reference, Usage usage, Position position,
}

void fillReferenceItem(ReferenceItem *referencesItem, char *name, int vApplClass,
int vFunClass, Type symType, Storage storage, ReferenceScope scope, Access accessFlags,
int vFunClass, Type symType, Storage storage, ReferenceScope scope,
ReferenceCategory category) {
referencesItem->linkName = name;
referencesItem->fileHash = 0; // Should really be: cxFileHashNumber(name);
Expand Down
2 changes: 1 addition & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int scheduleFileUsingTheMacro(void) {
tmpc = NULL;
fillReferenceItem(&references, olstringInMacroBody,
NO_FILE_NUMBER, NO_FILE_NUMBER, TypeMacro, StorageExtern,
ScopeGlobal, 0, CategoryGlobal);
ScopeGlobal, CategoryGlobal);

fillSymbolsMenu(&menu, references, 1, true, 0, UsageUsed, 0, UsageNone, noPosition);
if (sessionData.browserStack.top==NULL) {
Expand Down
2 changes: 1 addition & 1 deletion src/xref.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static FileItem *createListOfInputFileItems(void) {
static void fillReferenceItemForIncludeFile(ReferenceItem *referencesItem, int fileNumber) {
fillReferenceItem(referencesItem, LINK_NAME_INCLUDE_REFS,
fileNumber, fileNumber, TypeCppInclude, StorageExtern,
ScopeGlobal, 0, CategoryGlobal);
ScopeGlobal, CategoryGlobal);
}

static void makeIncludeClosureOfFilesToUpdate(void) {
Expand Down
3 changes: 1 addition & 2 deletions src/yylex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1830,8 +1830,7 @@ static void addMacroBaseUsageRef(Symbol *macroSymbol) {

basePos = makePosition(inputFileNumber, 0, 0);
fillReferenceItem(&ppp, macroSymbol->linkName,
NO_FILE_NUMBER, NO_FILE_NUMBER, TypeMacro, StorageDefault, ScopeGlobal,
0, CategoryGlobal);
NO_FILE_NUMBER, NO_FILE_NUMBER, TypeMacro, StorageDefault, ScopeGlobal, CategoryGlobal);
isMember = isMemberInReferenceTable(&ppp, NULL, &memb);
r = NULL;
if (isMember) {
Expand Down

0 comments on commit a2f68b3

Please sign in to comment.