Project

General

Profile

Bug #330 » 0017-Correct-hashs-to-hashes.patch

S3_1 - Marko Lindqvist, 03/22/2024 01:33 AM

View differences:

client/gui-gtk-3.0/editprop.c
case VALTYPE_NATION:
return pva->data.v_nation == pvb->data.v_nation;
case VALTYPE_NATION_HASH:
return nation_hashs_are_equal(pva->data.v_nation_hash,
pvb->data.v_nation_hash);
return nation_hashes_are_equal(pva->data.v_nation_hash,
pvb->data.v_nation_hash);
case VALTYPE_GOV:
return pva->data.v_gov == pvb->data.v_gov;
case VALTYPE_TILE_VISION_DATA:
client/gui-gtk-3.22/editprop.c
case VALTYPE_NATION:
return pva->data.v_nation == pvb->data.v_nation;
case VALTYPE_NATION_HASH:
return nation_hashs_are_equal(pva->data.v_nation_hash,
pvb->data.v_nation_hash);
return nation_hashes_are_equal(pva->data.v_nation_hash,
pvb->data.v_nation_hash);
case VALTYPE_GOV:
return pva->data.v_gov == pvb->data.v_gov;
case VALTYPE_TILE_VISION_DATA:
client/gui-gtk-4.0/editprop.c
case VALTYPE_NATION:
return pva->data.v_nation == pvb->data.v_nation;
case VALTYPE_NATION_HASH:
return nation_hashs_are_equal(pva->data.v_nation_hash,
pvb->data.v_nation_hash);
return nation_hashes_are_equal(pva->data.v_nation_hash,
pvb->data.v_nation_hash);
case VALTYPE_GOV:
return pva->data.v_gov == pvb->data.v_gov;
case VALTYPE_TILE_VISION_DATA:
common/idex.c
#include "idex.h"
/**********************************************************************//**
Initialize. Should call this at the start before use.
Initialize. Should call this at the start before use.
**************************************************************************/
void idex_init(struct world *iworld)
{
......
}
/**********************************************************************//**
Free the hashs.
Free the hashes.
**************************************************************************/
void idex_free(struct world *iworld)
{
common/networking/connection.c
}
/**********************************************************************//**
Allocate and initialize packet hashs for given connection.
Allocate and initialize packet hashes for given connection.
**************************************************************************/
static void init_packet_hashs(struct connection *pc)
static void init_packet_hashes(struct connection *pc)
{
enum packet_type i;
......
pconn->json_mode = TRUE;
#endif /* FREECIV_JSON_CONNECTION */
init_packet_hashs(pconn);
init_packet_hashes(pconn);
#ifdef USE_COMPRESSION
byte_vector_init(&pconn->compression.queue);
utility/genhash.c
/************************************************************************//**
Returns TRUE iff the hash tables contains the same pairs of key/data.
****************************************************************************/
bool genhashs_are_equal(const struct genhash *pgenhash1,
const struct genhash *pgenhash2)
bool genhashes_are_equal(const struct genhash *pgenhash1,
const struct genhash *pgenhash2)
{
return genhashs_are_equal_full(pgenhash1, pgenhash2, NULL);
return genhashes_are_equal_full(pgenhash1, pgenhash2, NULL);
}
/************************************************************************//**
Returns TRUE iff the hash tables contains the same pairs of key/data.
****************************************************************************/
bool genhashs_are_equal_full(const struct genhash *pgenhash1,
const struct genhash *pgenhash2,
genhash_comp_fn_t data_comp_func)
bool genhashes_are_equal_full(const struct genhash *pgenhash1,
const struct genhash *pgenhash2,
genhash_comp_fn_t data_comp_func)
{
struct genhash_entry *const *bucket1, *const *max1, *const *slot2;
const struct genhash_entry *iter1;
utility/genhash.h
bool genhash_remove_full(struct genhash *pgenhash, const void *key,
void **deleted_pkey, void **deleted_pdata);
bool genhashs_are_equal(const struct genhash *pgenhash1,
const struct genhash *pgenhash2);
bool genhashs_are_equal_full(const struct genhash *pgenhash1,
const struct genhash *pgenhash2,
genhash_comp_fn_t data_comp_func);
bool genhashes_are_equal(const struct genhash *pgenhash1,
const struct genhash *pgenhash2);
bool genhashes_are_equal_full(const struct genhash *pgenhash1,
const struct genhash *pgenhash2,
genhash_comp_fn_t data_comp_func);
/* Iteration. */
utility/spechash.h
GNU General Public License for more details.
***********************************************************************/
/* spechashs: "specific genhash".
/* spechashes: "specific genhash".
*
* This file is used to implement a "specific" genhash.
* That is, a (sometimes) type-checked genhash. (Or at least a
......
* bool foo_hash_remove_full(struct foo_hash *phash, const key_t key,
* key_t *deleted_pkey, data_t *deleted_pdata);
*
* bool foo_hashs_are_equal(const struct foo_hash *phash1,
* const struct foo_hash *phash2);
* bool foo_hashs_are_equal_full(const struct foo_hash *phash1,
* const struct foo_hash *phash2,
* foo_hash_data_comp_fn_t data_comp_func);
* bool foo_hashes_are_equal(const struct foo_hash *phash1,
* const struct foo_hash *phash2);
* bool foo_hashes_are_equal_full(const struct foo_hash *phash1,
* const struct foo_hash *phash2,
* foo_hash_data_comp_fn_t data_comp_func);
*
* size_t foo_hash_iter_sizeof(void);
* struct iterator *foo_hash_iter_init(struct foo_hash_iter *iter,
......
Compare the specific hash tables.
****************************************************************************/
static inline bool
SPECHASH_FOO(_hashs_are_equal_full) (const SPECHASH_HASH *phash1,
const SPECHASH_HASH *phash2,
SPECHASH_FOO(_hash_data_comp_fn_t)
data_comp_func)
SPECHASH_FOO(_hashes_are_equal_full) (const SPECHASH_HASH *phash1,
const SPECHASH_HASH *phash2,
SPECHASH_FOO(_hash_data_comp_fn_t)
data_comp_func)
{
return genhashs_are_equal_full((const struct genhash *) phash1,
(const struct genhash *) phash2,
(genhash_comp_fn_t) data_comp_func);
return genhashes_are_equal_full((const struct genhash *) phash1,
(const struct genhash *) phash2,
(genhash_comp_fn_t) data_comp_func);
}
/************************************************************************//**
Compare the specific hash tables.
****************************************************************************/
static inline bool
SPECHASH_FOO(_hashs_are_equal) (const SPECHASH_HASH *phash1,
const SPECHASH_HASH *phash2)
SPECHASH_FOO(_hashes_are_equal) (const SPECHASH_HASH *phash1,
const SPECHASH_HASH *phash2)
{
return SPECHASH_FOO(_hashs_are_equal_full) (phash1, phash2,
SPECHASH_IDATA_COMP);
return SPECHASH_FOO(_hashes_are_equal_full) (phash1, phash2,
SPECHASH_IDATA_COMP);
}
/************************************************************************//**
(3-3/3)