From 5fd408dd19bc707744359977f839e12c80057c84 Mon Sep 17 00:00:00 2001 From: Alfredo Fanghella Date: Sat, 25 Jun 2016 01:52:22 -0400 Subject: [PATCH] =?UTF-8?q?Correci=C3=B3n=20al=20eliminar=20de=20conjunto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configuracion.h | 12 ++++++++---- conjunto_hash.c | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/configuracion.h b/configuracion.h index 3faaec1..d17a02d 100644 --- a/configuracion.h +++ b/configuracion.h @@ -1,6 +1,10 @@ +#ifndef CONFIGURACIONES +#define CONFIGURACIONES + #define NUM_INTENTOS 3 //Número máximo de intentos si el server no responde -#define LON_MAX_MENSAJE 100 //Longitud máxima del buffer de mensajes FIXME Hay que cambiarlo -#define NUM_MAX_PUESTOS 200 //Capacidad del estacionamiento FIXME esto está dado -#define TIEMPO_MAX_USEG 100000 //Tiempo de espera de servidor máximo en miles de milisegundos -#define TIEMPO_MAX_SEG 0 //Tiempo de espera de servidor máximo en segundos (Se suma con el anterior) +#define NUM_MAX_PUESTOS 200 //Capacidad del estacionamiento +#define TIEMPO_MAX_USEG 0 //Tiempo de espera de servidor máximo en miles de milisegundos +#define TIEMPO_MAX_SEG 1 //Tiempo de espera de servidor máximo en segundos (Se suma con el anterior) #define MAX_PUERTO 65535 // número máximo de puertos + +#endif diff --git a/conjunto_hash.c b/conjunto_hash.c index 872e755..a65857c 100644 --- a/conjunto_hash.c +++ b/conjunto_hash.c @@ -96,7 +96,7 @@ bool insertarEnConj(conjunto * c, uint32_t identificador, time_t tiempo) { */ bool eliminarEnConj(conjunto *c, uint32_t identificador, time_t *tiempoEstacionado){ int hash = identificador % TAM_HASH; - int n; + int n = 0; while (n < TAM_HASH) { if (c->elems[hash].estado == OCUPADO) {