Constification

This commit is contained in:
Jasmine Iwanek
2023-07-20 18:58:26 -04:00
parent db66543959
commit 998cfe5cc8
163 changed files with 1086 additions and 1071 deletions

View File

@@ -329,7 +329,7 @@ static uint8_t nvr_at_inited = 0;
static void
time_get(nvr_t *nvr, struct tm *tm)
{
local_t *local = (local_t *) nvr->data;
const local_t *local = (local_t *) nvr->data;
int8_t temp;
if (nvr->regs[RTC_REGB] & REGB_DM) {
@@ -367,7 +367,7 @@ time_get(nvr_t *nvr, struct tm *tm)
static void
time_set(nvr_t *nvr, struct tm *tm)
{
local_t *local = (local_t *) nvr->data;
const local_t *local = (local_t *) nvr->data;
int year = (tm->tm_year + 1900);
if (nvr->regs[RTC_REGB] & REGB_DM) {
@@ -426,7 +426,7 @@ check_alarm(nvr_t *nvr, int8_t addr)
static int8_t
check_alarm_via(nvr_t *nvr, int8_t addr, int8_t addr_2)
{
local_t *local = (local_t *) nvr->data;
const local_t *local = (local_t *) nvr->data;
if (local->cent == RTC_CENTURY_VIA) {
return ((nvr->regs[addr_2] == nvr->regs[addr]) || ((nvr->regs[addr_2] & AL_DONTCARE) == AL_DONTCARE));
@@ -518,8 +518,8 @@ timer_load_count(nvr_t *nvr)
static void
timer_intr(void *priv)
{
nvr_t *nvr = (nvr_t *) priv;
local_t *local = (local_t *) nvr->data;
nvr_t *nvr = (nvr_t *) priv;
const local_t *local = (local_t *) nvr->data;
if (local->state == 1) {
timer_load_count(nvr);
@@ -680,12 +680,12 @@ nvr_write(uint16_t addr, uint8_t val, void *priv)
static uint8_t
nvr_read(uint16_t addr, void *priv)
{
nvr_t *nvr = (nvr_t *) priv;
local_t *local = (local_t *) nvr->data;
uint8_t ret;
uint8_t addr_id = (addr & 0x0e) >> 1;
uint16_t i;
uint16_t checksum = 0x0000;
nvr_t *nvr = (nvr_t *) priv;
const local_t *local = (local_t *) nvr->data;
uint8_t ret;
uint8_t addr_id = (addr & 0x0e) >> 1;
uint16_t i;
uint16_t checksum = 0x0000;
cycles -= ISA_CYCLES(8);
@@ -832,7 +832,7 @@ nvr_sec_read(uint16_t addr, void *priv)
static void
nvr_reset(nvr_t *nvr)
{
local_t *local = (local_t *) nvr->data;
const local_t *local = (local_t *) nvr->data;
#if 0
memset(nvr->regs, local->def, RTC_REGS);
@@ -851,7 +851,7 @@ nvr_reset(nvr_t *nvr)
static void
nvr_start(nvr_t *nvr)
{
local_t *local = (local_t *) nvr->data;
const local_t *local = (local_t *) nvr->data;
struct tm tm;
int default_found = 0;