Skip to content

Commit 8ff5c4f

Browse files
committed
refactor: enforce snake case, change/translate many words
1 parent a7d59f5 commit 8ff5c4f

28 files changed

Lines changed: 555 additions & 546 deletions

IDE/IDEMain.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "IDEMain.h"
1111
#include "IDEConfig.h"
1212
#include "SinaisDrawPane.h"
13+
#include "estruturas.h"
1314
#include "inout.h"
1415
#include "sinais.h"
1516
#include "util.h"

IDE/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LFLAGS=`wx-config --libs`
1111
TARGET=ide
1212

1313
_OBJ = IDEMain.o IDEApp.o IDEConfig.o EdicaoDeSinal.o SinaisDrawPane.o util.o
14-
_OBJ += inout.o lex.o mem.o sinais.o strutil.o erros.o
14+
_OBJ += inout.o lex.o mem.o sinais.o strutil.o erros.o eventos.o
1515
OBJ = $(patsubst %, $(OBJ_DIR)/%, $(_OBJ))
1616

1717
default: makedir all

IDE/SinaisDrawPane.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include "SinaisDrawPane.h"
1515
#include "EdicaoDeSinal.h"
16+
#include "estruturas.h"
1617
#include "sinais.h"
1718
#include "inout.h"
1819
#include "util.h"

IDE/util.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77

88
#include <cstdio>
99

10-
#include "util.h"
10+
#include "estruturas.h"
1111
#include "sinais.h"
12+
#include "util.h"
1213

13-
extern "C" Sinais* carregaEntradas(FILE* arquivo);
14+
extern "C" Sinais* load_input_signals(FILE* file);
1415

1516
Sinais* load_signals_from_path(const char* path)
1617
{
@@ -26,7 +27,7 @@ Sinais* load_signals_from_path(const char* path)
2627

2728
printf("Abrindo o arquivo de sinais: %s\n", path);
2829

29-
Sinais* waves = carregaEntradas(waveFile);
30+
Sinais* waves = load_input_signals(waveFile);
3031

3132
fclose(waveFile);
3233

estruturas.c

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/*
2-
Progres - Simulador de circuitos combinacionais em Verilog
3-
(C) 2014, 2015 Tiago Matos Santos
1+
/********************************
2+
Progres - Verilog Simulator
3+
(C) 2014-2025 Tiago Matos
44
5-
Under the terms of the MIT license.
6-
*/
5+
Under terms of the MIT license.
6+
*********************************/
77

88
#include <stdio.h>
99
#include <stdlib.h>
@@ -17,19 +17,19 @@
1717
#include "erros.h"
1818
#include "mem.h"
1919

20-
Module* novoCircuito()
20+
Module* new_module()
2121
{
2222
Module *circuito = (Module*) xmalloc(sizeof(Module));
2323

24-
circuito->listaFiosEntrada = novaListaComponente();
24+
circuito->listaFiosEntrada = new_list_component();
2525
circuito->sinaisEntrada = NULL;
2626

27-
circuito->listaFiosSaida = novaListaComponente();
27+
circuito->listaFiosSaida = new_list_component();
2828
circuito->sinaisSaida = NULL;
2929

30-
circuito->listaWires = novaListaComponente();
30+
circuito->listaWires = new_list_component();
3131

32-
circuito->listaPortas = novaListaComponente();
32+
circuito->listaPortas = new_list_component();
3333

3434
circuito->listaReg.total = 0;
3535
circuito->listaReg.itens = NULL;
@@ -73,49 +73,49 @@ void free_module(Module** mod)
7373
*mod = NULL;
7474
}
7575

76-
void adicionaEntrada(Module* circ, Component* comp)
76+
void add_input(Module* circ, Component* comp)
7777
{
7878
if(!circ || !comp)
7979
return;
8080

81-
insereComponente(circ->listaFiosEntrada, comp);
81+
insert_component(circ->listaFiosEntrada, comp);
8282
}
8383

84-
void adicionaSaida(Module* circ, Component* comp)
84+
void add_output(Module* circ, Component* comp)
8585
{
8686
if(!circ || !comp)
8787
return;
8888

89-
insereComponente(circ->listaFiosSaida, comp);
89+
insert_component(circ->listaFiosSaida, comp);
9090
}
9191

92-
void adicionaWire(Module* circ, Component* comp)
92+
void add_wire(Module* circ, Component* comp)
9393
{
9494
if(!circ || !comp)
9595
return;
9696

97-
insereComponente(circ->listaWires, comp);
97+
insert_component(circ->listaWires, comp);
9898
}
9999

100-
void adicionaPorta(Module* circ, Component* comp)
100+
void add_gate(Module* circ, Component* comp)
101101
{
102102
if(!circ || !comp)
103103
return;
104104

105-
insereComponente(circ->listaPortas, comp);
105+
insert_component(circ->listaPortas, comp);
106106
}
107107

108-
ListaComponente* novaListaComponente()
108+
ListComponent* new_list_component()
109109
{
110-
return novaListaComponenteTamanho(0);
110+
return new_list_component_of_size(0);
111111
}
112112

113-
ListaComponente* novaListaComponenteTamanho(unsigned int size)
113+
ListComponent* new_list_component_of_size(unsigned int size)
114114
{
115115
unsigned int i;
116-
ListaComponente* list_comp;
116+
ListComponent* list_comp;
117117

118-
list_comp = (ListaComponente*) xmalloc( sizeof(ListaComponente) );
118+
list_comp = (ListComponent*) xmalloc( sizeof(ListComponent) );
119119
list_comp->tamanho = size;
120120

121121
if (size == 0) {
@@ -132,7 +132,7 @@ ListaComponente* novaListaComponenteTamanho(unsigned int size)
132132
return list_comp;
133133
}
134134

135-
void delete_list_component(ListaComponente** ppl)
135+
void delete_list_component(ListComponent** ppl)
136136
{
137137
if ( *ppl == NULL )
138138
return;
@@ -154,7 +154,7 @@ void delete_list_component(ListaComponente** ppl)
154154
*ppl = NULL;
155155
}
156156

157-
void insereComponente(ListaComponente* ls, Component* cp)
157+
void insert_component(ListComponent* ls, Component* cp)
158158
{
159159
ls->tamanho++;
160160

@@ -168,7 +168,7 @@ void insereComponente(ListaComponente* ls, Component* cp)
168168
ls->itens[ls->tamanho - 1] = cp;
169169
}
170170

171-
void addRegister(Module* circ, const char* name, unsigned int size, int is_signed)
171+
void add_register(Module* circ, const char* name, unsigned int size, int is_signed)
172172
{
173173
Register* reg = (Register*) xmalloc(sizeof(Register));
174174

@@ -206,7 +206,7 @@ Register* get_reg_by_name(ListaReg list, const char* name)
206206
return NULL;
207207
}
208208

209-
void addParam(Module* circ, Param* param)
209+
void add_param(Module* circ, Param* param)
210210
{
211211
if(circ->listaParam.total == 0) {
212212
circ->listaParam.total++;
@@ -237,7 +237,7 @@ Param* get_param_by_name(ListaParam list, const char* name)
237237
return NULL;
238238
}
239239

240-
int contemComponente(ListaComponente* ls, Component* cp)
240+
int has_component_by_pointer(ListComponent* ls, Component* cp)
241241
{
242242
int i;
243243

@@ -253,7 +253,7 @@ int contemComponente(ListaComponente* ls, Component* cp)
253253
return 0;
254254
}
255255

256-
Component* novoComponente(const char* nome, t_operador porta)
256+
Component* new_component(const char* nome, t_operador porta)
257257
{
258258
Component* c = (Component*) xmalloc( sizeof(Component) );
259259

@@ -267,8 +267,8 @@ Component* novoComponente(const char* nome, t_operador porta)
267267
c->sinalSaida = NULL;
268268

269269
if (porta != LITERAL_NUMBER) {
270-
c->listaEntrada = novaListaComponente();
271-
c->listaSaida = novaListaComponente();
270+
c->listaEntrada = new_list_component();
271+
c->listaSaida = new_list_component();
272272
}
273273

274274
c->valorDinamico = VAL_X;
@@ -299,7 +299,7 @@ void delete_componente(Component** c)
299299
*c = NULL;
300300
}
301301

302-
Component* getComponenteItemPorNome(ListaComponente* ls, const char* nome)
302+
Component* get_component_by_name(ListComponent* ls, const char* nome)
303303
{
304304
int i;
305305

@@ -315,34 +315,34 @@ Component* getComponenteItemPorNome(ListaComponente* ls, const char* nome)
315315
return NULL;
316316
}
317317

318-
Component* getPortaPorNome(Module* circ, const char* nome)
318+
Component* get_gate_by_name(Module* circ, const char* nome)
319319
{
320320
if(!circ || !nome)
321321
return NULL;
322322

323-
return getComponenteItemPorNome(circ->listaPortas, nome);
323+
return get_component_by_name(circ->listaPortas, nome);
324324
}
325325

326-
Component* getWirePorNome(Module* circ, const char* nome)
326+
Component* get_wire_by_name(Module* circ, const char* nome)
327327
{
328328
if(!circ || !nome)
329329
return NULL;
330330

331-
return getComponenteItemPorNome(circ->listaWires, nome);
331+
return get_component_by_name(circ->listaWires, nome);
332332
}
333333

334-
Component* getInputPorNome(Module* circ, const char* nome)
334+
Component* get_input_by_name(Module* circ, const char* nome)
335335
{
336336
if(!circ || !nome)
337337
return NULL;
338338

339-
return getComponenteItemPorNome(circ->listaFiosEntrada, nome);
339+
return get_component_by_name(circ->listaFiosEntrada, nome);
340340
}
341341

342-
Component* getOutputPorNome(Module* circ, const char* nome)
342+
Component* get_output_by_name(Module* circ, const char* nome)
343343
{
344344
if(!circ || !nome)
345345
return NULL;
346346

347-
return getComponenteItemPorNome(circ->listaFiosSaida, nome);
347+
return get_component_by_name(circ->listaFiosSaida, nome);
348348
}

0 commit comments

Comments
 (0)