OBJECT_IDX item;
object_type *o_ptr;
o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_EQUIP), 0);
- if (!o_ptr) return (0);
+ if (!o_ptr) return 0;
/* It is worthless */
if (!object_is_ego(o_ptr) && !object_is_artifact(o_ptr))
{
msg_format(_("それは直してもしょうがないぜ。", "It is worthless to repair."));
- return (0);
+ return 0;
}
/* They are too many */
if (o_ptr->number > 1)
{
msg_format(_("一度に複数を修復することはできません!", "They are too many to repair at once!"));
- return (0);
+ return 0;
}
/* Display item name */
OBJECT_IDX mater;
object_type *mo_ptr;
mo_ptr = choose_object(player_ptr, &mater, q, s, (USE_INVEN | USE_EQUIP), 0);
- if (!mo_ptr) return (0);
+ if (!mo_ptr) return 0;
if (mater == item)
{
msg_print(_("クラインの壷じゃない!", "This is not a klein bottle!"));
- return (0);
+ return 0;
}
/* Display item name */
object_desc(basenm, o_ptr, OD_NAME_ONLY);
msg_format(_("%sを修復するだけのゴールドがありません!", "You do not have the gold to repair %s!"), basenm);
msg_print(NULL);
- return (0);
+ return 0;
}
player_ptr->total_weight -= o_ptr->weight;
ring.wptr = ring.rptr = ring.inlen = 0;
fresh_queue.time[0] = 0;
ring.buf = malloc(RINGBUF_SIZE);
- if (ring.buf == NULL) return (-1);
+ if (ring.buf == NULL) return -1;
- return (0);
+ return 0;
}
/* 現在の時間を100ms単位で取得する */
close(sd);
#endif
- return (-1);
+ return -1;
}
/* バッファの終端までに収まる */
ring.inlen += len;
/* Success */
- return (0);
+ return 0;
}
#ifdef CHUUKEI
path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA, prf_name);
fp = my_fopen(buf, "r");
- if (!fp) return (-1);
+ if (!fp) return -1;
/* 初期化 */
server_port = -1;
my_fclose(fp);
/* prfファイルが完全でない */
- if (server_port == -1 || server_name[0] == 0) return (-1);
+ if (server_port == -1 || server_name[0] == 0) return -1;
- return (0);
+ return 0;
}
int connect_chuukei_server(char *prf_name)
if (read_chuukei_prf(prf_name) < 0)
{
printf("Wrong prf file\n");
- return (-1);
+ return -1;
}
if (init_buffer() < 0)
{
printf("Malloc error\n");
- return (-1);
+ return -1;
}
#ifdef WINDOWS
if (WSAStartup(wVersionRequested, &wsaData))
{
msg_print("Report: WSAStartup failed.");
- return (-1);
+ return -1;
}
#endif
if ((ask.sin_addr.s_addr=inet_addr(server_name)) == 0)
{
printf("Bad hostname\n");
- return (-1);
+ return -1;
}
}
#endif
{
printf("Can't create socket\n");
- return (-1);
+ return -1;
}
if (connect(sd, (struct sockaddr *)&ask, sizeof(ask)) < 0)
{
close(sd);
printf("Can't connect %s port %d\n", server_name, server_port);
- return (-1);
+ return -1;
}
- return (0);
+ return 0;
#else /* MACINTOSH */
OSStatus err;
InetHostInfo response;
if (read_chuukei_prf(prf_name) < 0){
printf("Wrong prf file\n");
- return (-1);
+ return -1;
}
init_buffer();
msg_format(_("%s を開くことができませんでした。プレイ記録を一時停止します。", "Failed to open %s. Play-Record is disabled temporarily."), buf);
msg_format(NULL);
disable_diary=TRUE;
- return (-1);
+ return -1;
}
q_idx = quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level);
if (do_level) write_level = FALSE;
- return (0);
+ return 0;
}
FILE_TYPE(FILE_TYPE_TEXT);
/* Append to the file */
- if (!open_auto_dump(buf, mark)) return (-1);
+ if (!open_auto_dump(buf, mark)) return -1;
/* Start dumping */
auto_dump_printf(_("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n"));
}
close_auto_dump();
- return (0);
+ return 0;
}
}
close_auto_dump();
- return (0);
+ return 0;
}
{
/* Must do at least 95% of perfect */
int total = dice * sides;
- if (dam < total * 19 / 20) return (0);
+ if (dam < total * 19 / 20) return 0;
/* Weak blows rarely work */
- if ((dam < 20) && (randint0(100) >= dam)) return (0);
+ if ((dam < 20) && (randint0(100) >= dam)) return 0;
/* Perfect damage */
int max = 0;
i = atoi(buf + 2);
/* Verify information */
- if (i <= error_idx) return (4);
+ if (i <= error_idx) return 4;
/* Verify information */
- if (i >= head->info_num) return (2);
+ if (i >= head->info_num) return 2;
/* Save the index */
error_idx = i;
v_ptr = &v_info[i];
/* Store the name */
- if (!add_name(&v_ptr->name, head, s)) return (7);
+ if (!add_name(&v_ptr->name, head, s)) return 7;
}
/* There better be a current v_ptr */
- else if (!v_ptr) return (3);
+ else if (!v_ptr) return 3;
/* Process 'D' for "Description" */
else if (buf[0] == 'D')
s = buf + 2;
/* Store the text */
- if (!add_text(&v_ptr->text, head, s, FALSE)) return (7);
+ if (!add_text(&v_ptr->text, head, s, FALSE)) return 7;
}
/* Process 'X' for "Extra info" (one line only) */
v_ptr->wid = (POSITION)wid;
}
- else return (6);
+ else return 6;
/* Success */
return 0;
i = atoi(buf + 2);
/* Verify information */
- if (i <= error_idx) return (4);
+ if (i <= error_idx) return 4;
/* Verify information */
- if (i >= head->info_num) return (2);
+ if (i >= head->info_num) return 2;
/* Save the index */
error_idx = i;
}
/* There better be a current s_ptr */
- else if (!s_ptr) return (3);
+ else if (!s_ptr) return 3;
/* Process 'W' for "Weapon exp" */
else if (buf[0] == 'W')
&tval, &sval, &start, &max)) return 1;
if (start < EXP_LEVEL_UNSKILLED || start > EXP_LEVEL_MASTER
- || max < EXP_LEVEL_UNSKILLED || max > EXP_LEVEL_MASTER) return (8);
+ || max < EXP_LEVEL_UNSKILLED || max > EXP_LEVEL_MASTER) return 8;
/* Save the values */
s_ptr->w_start[tval][sval] = exp_conv_table[start];
&num, &start, &max)) return 1;
if (start < WEAPON_EXP_UNSKILLED || start > WEAPON_EXP_MASTER
- || max < WEAPON_EXP_UNSKILLED || max > WEAPON_EXP_MASTER) return (8);
+ || max < WEAPON_EXP_UNSKILLED || max > WEAPON_EXP_MASTER) return 8;
/* Save the values */
s_ptr->s_start[num] = (SUB_EXP)start;
}
- else return (6);
+ else return 6;
/* Success */
return 0;
i = atoi(buf + 2);
/* Verify information */
- if (i <= error_idx) return (4);
+ if (i <= error_idx) return 4;
/* Verify information */
- if (i >= head->info_num) return (2);
+ if (i >= head->info_num) return 2;
/* Save the index */
error_idx = i;
}
/* There better be a current m_ptr */
- else if (!m_ptr) return (3);
+ else if (!m_ptr) return 3;
/* Process 'I' for "Info" (one line only) */
else if (buf[0] == 'I')
else if (streq(book, "MUSIC")) m_ptr->spell_book = TV_MUSIC_BOOK;
else if (streq(book, "HISSATSU")) m_ptr->spell_book = TV_HISSATSU_BOOK;
else if (streq(book, "NONE")) m_ptr->spell_book = 0;
- else return (5);
+ else return 5;
stat = s;
else if (streq(stat, "DEX")) m_ptr->spell_stat = A_DEX;
else if (streq(stat, "CON")) m_ptr->spell_stat = A_CON;
else if (streq(stat, "CHR")) m_ptr->spell_stat = A_CHR;
- else return (5);
+ else return 5;
/* Scan for the values */
m_ptr->info[realm][magic_idx].sexp = (EXP)exp;
magic_idx++;
}
- else return (6);
+ else return 6;
return 0;
}
i = atoi(buf + 2);
/* Verify information */
- if (i <= error_idx) return (4);
+ if (i <= error_idx) return 4;
/* Verify information */
- if (i >= head->info_num) return (2);
+ if (i >= head->info_num) return 2;
/* Save the index */
error_idx = i;
if (s)
{
/* Store the tag */
- if (!add_tag(&f_ptr->tag, head, s)) return (7);
+ if (!add_tag(&f_ptr->tag, head, s)) return 7;
}
/* Default "mimic" */
}
/* There better be a current f_ptr */
- else if (!f_ptr) return (3);
+ else if (!f_ptr) return 3;
#ifdef JP
else if (buf[0] == 'J')
{
/* Store the name */
- if (!add_name(&f_ptr->name, head, buf + 2)) return (7);
+ if (!add_name(&f_ptr->name, head, buf + 2)) return 7;
}
else if (buf[0] == 'E')
s = buf + 2;
/* Store the name */
- if (!add_name(&f_ptr->name, head, s)) return (7);
+ if (!add_name(&f_ptr->name, head, s)) return 7;
}
#endif
f_ptr->state[i].result_tag = offset;
}
}
- else return (6);
+ else return 6;
return 0;
}
i = atoi(buf + 2);
/* Verify information */
- if (i <= error_idx) return (4);
+ if (i <= error_idx) return 4;
/* Verify information */
- if (i >= head->info_num) return (2);
+ if (i >= head->info_num) return 2;
/* Save the index */
error_idx = i;
*flavor++ = '\0';
/* Store the flavor */
- if (!add_name(&k_ptr->flavor_name, head, flavor)) return (7);
+ if (!add_name(&k_ptr->flavor_name, head, flavor)) return 7;
}
/* Store the name */
- if (!add_name(&k_ptr->name, head, s)) return (7);
+ if (!add_name(&k_ptr->name, head, s)) return 7;
#endif
}
/* There better be a current k_ptr */
- else if (!k_ptr) return (3);
+ else if (!k_ptr) return 3;
#ifdef JP
*flavor++ = '\0';
/* Store the flavor */
- if (!add_name(&k_ptr->flavor_name, head, flavor)) return (7);
+ if (!add_name(&k_ptr->flavor_name, head, flavor)) return 7;
}
/* Store the name */
- if (!add_name(&k_ptr->name, head, s)) return (7);
+ if (!add_name(&k_ptr->name, head, s)) return 7;
}
#endif
#endif
/* Store the text */
- if (!add_text(&k_ptr->text, head, s, TRUE)) return (7);
+ if (!add_text(&k_ptr->text, head, s, TRUE)) return 7;
}
/* Process 'G' for "Graphics" (one line only) */
}
else
{
- return (5);
+ return 5;
}
}
}
/* Parse this entry */
- if (0 != grab_one_kind_flag(k_ptr, s)) return (5);
+ if (0 != grab_one_kind_flag(k_ptr, s)) return 5;
/* Start the next entry */
s = t;
}
}
- else return (6);
+ else return 6;
return 0;
}
i = atoi(buf + 2);
/* Verify information */
- if (i < error_idx) return (4);
+ if (i < error_idx) return 4;
/* Verify information */
- if (i >= head->info_num) return (2);
+ if (i >= head->info_num) return 2;
/* Save the index */
error_idx = i;
add_flag(a_ptr->flags, TR_IGNORE_COLD);
#ifdef JP
/* Store the name */
- if (!add_name(&a_ptr->name, head, s)) return (7);
+ if (!add_name(&a_ptr->name, head, s)) return 7;
#endif
}
/* There better be a current a_ptr */
- else if (!a_ptr) return (3);
+ else if (!a_ptr) return 3;
#ifdef JP
s = buf + 2;
/* Store the name */
- if (!add_name(&a_ptr->name, head, s)) return (7);
+ if (!add_name(&a_ptr->name, head, s)) return 7;
}
#endif
#endif
/* Store the text */
- if (!add_text(&a_ptr->text, head, s, TRUE)) return (7);
+ if (!add_text(&a_ptr->text, head, s, TRUE)) return 7;
}
}
else
{
- return (5);
+ return 5;
}
}
}
/* Parse this entry */
- if (0 != grab_one_artifact_flag(a_ptr, s)) return (5);
+ if (0 != grab_one_artifact_flag(a_ptr, s)) return 5;
/* Start the next entry */
s = t;
}
}
- else return (6);
+ else return 6;
return 0;
}
i = atoi(buf + 2);
/* Verify information */
- if (i < error_idx) return (4);
+ if (i < error_idx) return 4;
/* Verify information */
- if (i >= head->info_num) return (2);
+ if (i >= head->info_num) return 2;
/* Save the index */
error_idx = i;
e_ptr = &e_info[i];
#ifdef JP
/* Store the name */
- if (!add_name(&e_ptr->name, head, s)) return (7);
+ if (!add_name(&e_ptr->name, head, s)) return 7;
#endif
}
/* There better be a current e_ptr */
- else if (!e_ptr) return (3);
+ else if (!e_ptr) return 3;
#ifdef JP
s = buf + 2;
/* Store the name */
- if (!add_name(&e_ptr->name, head, s)) return (7);
+ if (!add_name(&e_ptr->name, head, s)) return 7;
}
#endif
#if 0
s = buf + 2;
/* Store the text */
- if (!add_text(&e_ptr->text, head, s, TRUE)) return (7);
+ if (!add_text(&e_ptr->text, head, s, TRUE)) return 7;
}
#endif
}
else
{
- return (5);
+ return 5;
}
}
}
/* Parse this entry */
- if (0 != grab_one_ego_item_flag(e_ptr, s)) return (5);
+ if (0 != grab_one_ego_item_flag(e_ptr, s)) return 5;
/* Start the next entry */
s = t;
}
}
- else return (6);
+ else return 6;
return 0;
}
i = atoi(buf + 2);
/* Verify information */
- if (i < error_idx) return (4);
+ if (i < error_idx) return 4;
/* Verify information */
- if (i >= head->info_num) return (2);
+ if (i >= head->info_num) return 2;
/* Save the index */
error_idx = i;
r_ptr = &r_info[i];
#ifdef JP
/* Store the name */
- if (!add_name(&r_ptr->name, head, s)) return (7);
+ if (!add_name(&r_ptr->name, head, s)) return 7;
#endif
}
/* There better be a current r_ptr */
- else if (!r_ptr) return (3);
+ else if (!r_ptr) return 3;
#ifdef JP
s = buf + 2;
/* Store the name */
- if (!add_name(&r_ptr->E_name, head, s)) return (7);
+ if (!add_name(&r_ptr->E_name, head, s)) return 7;
}
#else
else if (buf[0] == 'E')
s = buf + 2;
/* Store the name */
- if (!add_name(&r_ptr->name, head, s)) return (7);
+ if (!add_name(&r_ptr->name, head, s)) return 7;
}
#endif
/* Process 'D' for "Description" */
#endif
/* Store the text */
- if (!add_text(&r_ptr->text, head, s, TRUE)) return (7);
+ if (!add_text(&r_ptr->text, head, s, TRUE)) return 7;
}
/* Process 'G' for "Graphics" (one line only) */
}
/* Parse this entry */
- if (0 != grab_one_basic_flag(r_ptr, s)) return (5);
+ if (0 != grab_one_basic_flag(r_ptr, s)) return 5;
/* Start the next entry */
s = t;
}
/* Parse this entry */
- if (0 != grab_one_spell_flag(r_ptr, s)) return (5);
+ if (0 != grab_one_spell_flag(r_ptr, s)) return 5;
/* Start the next entry */
s = t;
if (3 != sscanf(buf + 2, "%d", &val)) return 1;
r_ptr->arena_ratio = (PERCENTAGE)val;
}
- else return (6);
+ else return 6;
return 0;
}
i = atoi(buf + 2);
/* Verify information */
- if (i < error_idx) return (4);
+ if (i < error_idx) return 4;
/* Verify information */
- if (i >= head->info_num) return (2);
+ if (i >= head->info_num) return 2;
/* Save the index */
error_idx = i;
d_ptr = &d_info[i];
#ifdef JP
/* Store the name */
- if (!add_name(&d_ptr->name, head, s)) return (7);
+ if (!add_name(&d_ptr->name, head, s)) return 7;
#endif
}
s = buf + 2;
/* Store the name */
- if (!add_name(&d_ptr->name, head, s)) return (7);
+ if (!add_name(&d_ptr->name, head, s)) return 7;
}
#endif
#endif
/* Store the text */
- if (!add_text(&d_ptr->text, head, s, TRUE)) return (7);
+ if (!add_text(&d_ptr->text, head, s, TRUE)) return 7;
}
/* Process 'W' for "More Info" (one line only) */
}
/* Parse this entry */
- if (0 != grab_one_dungeon_flag(d_ptr, s)) return (5);
+ if (0 != grab_one_dungeon_flag(d_ptr, s)) return 5;
/* Start the next entry */
s = t;
}
/* Parse this entry */
- if (0 != grab_one_basic_monster_flag(d_ptr, s)) return (5);
+ if (0 != grab_one_basic_monster_flag(d_ptr, s)) return 5;
/* Start the next entry */
s = t;
}
/* Parse this entry */
- if (0 != grab_one_spell_monster_flag(d_ptr, s)) return (5);
+ if (0 != grab_one_spell_monster_flag(d_ptr, s)) return 5;
/* Start the next entry */
s = t;
}
}
- else return (6);
+ else return 6;
return 0;
}
fp = my_fopen(buf, "r");
/* No such file */
- if (!fp) return (-1);
+ if (!fp) return -1;
/* Process the file */
int num = -1;
fp = my_fopen(name, "r");
/* No such file */
- if (!fp) return (-1);
+ if (!fp) return -1;
/* Process the file */
char buf[1024];
struct tm *tp;
/* No restrictions */
- if (!check_time_flag) return (0);
+ if (!check_time_flag) return 0;
/* Check for time violation */
c = time((time_t *)0);
tp = localtime(&c);
/* Violation */
- if (days[tp->tm_wday][tp->tm_hour + 4] != 'X') return (1);
+ if (days[tp->tm_wday][tp->tm_hour + 4] != 'X') return 1;
#endif
/* Success */
- return (0);
+ return 0;
}
fp = my_fopen(buf, "r");
/* No file, no restrictions */
- if (!fp) return (0);
+ if (!fp) return 0;
/* Assume restrictions */
check_time_flag = TRUE;
#endif
/* Success */
- return (0);
+ return 0;
}
struct statstime st;
/* Success if not checking */
- if (!check_load_value) return (0);
+ if (!check_load_value) return 0;
/* Check the load */
if (0 == rstat("localhost", &st))
long val2 = (long)(check_load_value)* FSCALE;
/* Check for violation */
- if (val1 >= val2) return (1);
+ if (val1 >= val2) return 1;
}
#endif
/* Success */
- return (0);
+ return 0;
}
fp = my_fopen(buf, "r");
/* No file, no restrictions */
- if (!fp) return (0);
+ if (!fp) return 0;
/* Default load */
check_load_value = 100;
#endif
/* Success */
- return (0);
+ return 0;
}
(void)inkey();
/* Error */
- return (-1);
+ return -1;
}
(void)make_character_dump(creature_ptr, fff);
dy = y - creature_ptr->y;
dx = x - creature_ptr->x;
- if (ABS(dx) > 1 || ABS(dy) > 1) return (0);
+ if (ABS(dx) > 1 || ABS(dy) > 1) return 0;
return d[dx + 1][dy + 1];
}
}
/* Success */
- return (0);
+ return 0;
}
}
/* Success */
- return (0);
+ return 0;
}
current_world_ptr->character_dungeon = TRUE;
/* Success */
- return (0);
+ return 0;
}
#endif
/* Success */
- return (0);
+ return 0;
}
/*!
/* Drop permissions */
safe_setuid_drop();
- if (!fff) return (-1);
+ if (!fff) return -1;
/* Call the sub-function */
err = rd_savefile_new_aux(p_ptr);
td->font_id = CreateFontIndirect(&(td->lf));
wid = td->lf.lfWidth;
hgt = td->lf.lfHeight;
- if (!td->font_id) return (1);
+ if (!td->font_id) return 1;
#else
/* Forget old font */
if (td->font_file)
}
/* No path given */
- if (!path) return (1);
+ if (!path) return 1;
/* Local copy */
strcpy(buf, path);
base = analyze_font(buf, &wid, &hgt);
/* Verify suffix */
- if (!suffix(base, ".FON")) return (1);
+ if (!suffix(base, ".FON")) return 1;
/* Verify file */
- if (!check_file(buf)) return (1);
+ if (!check_file(buf)) return 1;
/* Load the new font */
- if (!AddFontResource(buf)) return (1);
+ if (!AddFontResource(buf)) return 1;
/* Save new font name */
td->font_file = string_make(base);
td->font_hgt = hgt;
/* Success */
- return (0);
+ return 0;
}
(void)n;
/* Success */
- return (0);
+ return 0;
}
/* Success */
- return (0);
+ return 0;
}
}
/* Success */
- return (0);
+ return 0;
}
static errr Term_xtra_win_noise(void)
{
MessageBeep(MB_ICONASTERISK);
- return (0);
+ return 0;
}
#endif /* USE_SOUND */
/* Sound disabled */
- if (!use_sound) return (1);
+ if (!use_sound) return 1;
/* Illegal sound */
- if ((v < 0) || (v >= SOUND_MAX)) return (1);
+ if ((v < 0) || (v >= SOUND_MAX)) return 1;
#ifdef USE_SOUND
}
/* No sample */
- if (i == 0) return (1);
+ if (i == 0) return 1;
/* Build the path */
path_build(buf, 1024, ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_external(i)]);
#else /* USE_SOUND */
- return (1);
+ return 1;
#endif /* USE_SOUND */
}
mciSendCommand(mop.wDeviceID, MCI_CLOSE, 0, 0);
}
- if(!use_music) return (1);
+ if(!use_music) return 1;
/* Illegal sound */
- if(n == TERM_XTRA_MUSIC_BASIC && ((v < 0) || (v >= MUSIC_BASIC_MAX))) return (1);
+ if(n == TERM_XTRA_MUSIC_BASIC && ((v < 0) || (v >= MUSIC_BASIC_MAX))) return 1;
else if(v < 0 || v >= 1000) return(1); /*!< TODO */
#ifdef USE_MUSIC
/* No sample */
if (i == 0)
{
- return (1);
+ return 1;
}
switch(n)
if(current_music_type == n && current_music_id == v)
{
- return (0);
+ return 0;
}
current_music_type = n;
current_music_id = v;
mciSendCommand(mop.wDeviceID, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT, (DWORD)&mop);
mciSendCommand(mop.wDeviceID, MCI_SEEK, MCI_SEEK_TO_START, 0);
mciSendCommand(mop.wDeviceID, MCI_PLAY, MCI_NOTIFY, (DWORD)&mop);
- return (0);
+ return 0;
#endif /* WIN32 */
#else /* USE_MUSIC */
- return (1);
+ return 1;
#endif /* USE_MUSIC */
#endif /* WIN32 */
/* Success */
- return (0);
+ return 0;
}
DispatchMessage(&msg);
}
quit(NULL);
- return (0);
+ return 0;
}
if (current_world_ptr->character_dungeon) msg_print(_("モンスターが多すぎる!", "Too many monsters!"));
/* Try not to crash */
- return (0);
+ return 0;
}
}
/* Success */
- return (0);
+ return 0;
}
}
/* No legal monsters */
- if (total <= 0) return (0);
+ if (total <= 0) return 0;
/* Pick a monster */
value = randint0(total);
value = randnor(bonus, stand);
/* Enforce the minimum value */
- if (value < 0) return (0);
+ if (value < 0) return 0;
/* Enforce the maximum value */
if (value > max) return (max);
}
/* No slot available */
- return (-1);
+ return -1;
}
/*!
}
/* No legal objects */
- if (total <= 0) return (0);
+ if (total <= 0) return 0;
/* Pick an object */
if (!max_num) return FALSE;
/* Maximal "stacking" limit */
- if (total > max_num) return (0);
+ if (total > max_num) return 0;
/* They match, so they must be similar */
#endif
- return (0);
+ return 0;
}
if (current_world_ptr->wizard) msg_print(_("(破損)", "(breakage)"));
/* Failure */
- return (0);
+ return 0;
}
if (current_world_ptr->wizard) msg_print(_("(床スペースがない)", "(no floor space)"));
/* Failure */
- return (0);
+ return 0;
}
}
}
- if (owner_ptr->inven_cnt > INVEN_PACK) return (-1);
+ if (owner_ptr->inven_cnt > INVEN_PACK) return -1;
/* Find an empty slot */
for (j = 0; j <= INVEN_PACK; j++)
/* Get the item to take off */
o_ptr = &owner_ptr->inventory_list[item];
- if (amt <= 0) return (-1);
+ if (amt <= 0) return -1;
/* Verify */
if (amt > o_ptr->number) amt = o_ptr->number;
INVENTORY_IDX i = (INVENTORY_IDX)(islower(c) ? A2I(c) : -1) + INVEN_RARM;
/* Verify the index */
- if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
+ if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return -1;
if (select_ring_slot) return is_ring_slot(i) ? i : -1;
/* Empty slots can never be chosen */
- if (!owner_ptr->inventory_list[i].k_idx) return (-1);
+ if (!owner_ptr->inventory_list[i].k_idx) return -1;
return i;
}
INVENTORY_IDX i = (INVENTORY_IDX)(islower(c) ? A2I(c) : -1);
/* Verify the index */
- if ((i < 0) || (i > INVEN_PACK)) return (-1);
+ if ((i < 0) || (i > INVEN_PACK)) return -1;
/* Empty slots can never be chosen */
- if (!owner_ptr->inventory_list[i].k_idx) return (-1);
+ if (!owner_ptr->inventory_list[i].k_idx) return -1;
return i;
}
if (creature_ptr->blind || no_lite(creature_ptr))
{
msg_print(_("目が見えない!", "You cannot see!"));
- return (0);
+ return 0;
}
/* break run when leaving trap detected region */
if (disturb_trap_detect)
{
/* Break Run */
- return (0);
+ return 0;
}
}
}
monster_type *m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
/* Visible monster */
- if (m_ptr->ml) return (0);
+ if (m_ptr->ml) return 0;
}
}
}
}
- if (!new_dir) return (0);
+ if (!new_dir) return 0;
/* Access newly move grid */
g_ptr = &floor_ptr->grid_array[creature_ptr->y+ddy[new_dir]][creature_ptr->x+ddx[new_dir]];
/* Close door abort traveling */
- if (!easy_open && is_closed_door(g_ptr->feat)) return (0);
+ if (!easy_open && is_closed_door(g_ptr->feat)) return 0;
/* Visible and unignorable trap abort tarveling */
- if (!g_ptr->mimic && !trap_can_be_ignored(creature_ptr, g_ptr->feat)) return (0);
+ if (!g_ptr->mimic && !trap_can_be_ignored(creature_ptr, g_ptr->feat)) return 0;
/* Move new grid */
return new_dir;
/* No chance for success */
if ((creature_ptr->lev < min_level) || creature_ptr->confused)
{
- return (0);
+ return 0;
}
if (difficulty == 0) return 100;
fd_kill(file_name);
/* Success */
- return (0);
+ return 0;
}
wr_u32b(Rand_state[i]);
}
- return (0);
+ return 0;
}
static int highscore_where(high_score *score)
{
/* Paranoia -- it may not have opened */
- if (highscore_fd < 0) return (-1);
+ if (highscore_fd < 0) return -1;
/* Go to the start of the highscore file */
- if (highscore_seek(0)) return (-1);
+ if (highscore_seek(0)) return -1;
/* Read until we get to a higher score */
high_score the_score;
static int highscore_add(high_score *score)
{
/* Paranoia -- it may not have opened */
- if (highscore_fd < 0) return (-1);
+ if (highscore_fd < 0) return -1;
/* Determine where the score should go */
int slot = highscore_where(score);
/* Hack -- Not on the list */
- if (slot < 0) return (-1);
+ if (slot < 0) return -1;
/* Hack -- prepare to dump the new score */
high_score the_score = (*score);
for (int i = slot; !done && (i < MAX_HISCORES); i++)
{
/* Read the old guy, note errors */
- if (highscore_seek(i)) return (-1);
+ if (highscore_seek(i)) return -1;
if (highscore_read(&tmpscore)) done = TRUE;
/* Back up and dump the score we were holding */
- if (highscore_seek(i)) return (-1);
- if (highscore_write(&the_score)) return (-1);
+ if (highscore_seek(i)) return -1;
+ if (highscore_write(&the_score)) return -1;
/* Hack -- Save the old score, for the next pass */
the_score = tmpscore;
int i;
/* Hack -- Identical items cannot be stacked */
- if (o_ptr == j_ptr) return (0);
+ if (o_ptr == j_ptr) return 0;
/* Different objects cannot be stacked */
- if (o_ptr->k_idx != j_ptr->k_idx) return (0);
+ if (o_ptr->k_idx != j_ptr->k_idx) return 0;
/* Different charges (etc) cannot be stacked, unless wands or rods. */
- if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
+ if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return 0;
/* Require many identical values */
- if (o_ptr->to_h != j_ptr->to_h) return (0);
- if (o_ptr->to_d != j_ptr->to_d) return (0);
- if (o_ptr->to_a != j_ptr->to_a) return (0);
+ if (o_ptr->to_h != j_ptr->to_h) return 0;
+ if (o_ptr->to_d != j_ptr->to_d) return 0;
+ if (o_ptr->to_a != j_ptr->to_a) return 0;
/* Require identical "ego-item" names */
- if (o_ptr->name2 != j_ptr->name2) return (0);
+ if (o_ptr->name2 != j_ptr->name2) return 0;
/* Artifacts don't stack! */
- if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
+ if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return 0;
/* Hack -- Identical art_flags! */
for (i = 0; i < TR_FLAG_SIZE; i++)
- if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
+ if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return 0;
/* Hack -- Never stack "powerful" items */
- if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
+ if (o_ptr->xtra1 || j_ptr->xtra1) return 0;
/* Hack -- Never stack recharging items */
- if (o_ptr->timeout || j_ptr->timeout) return (0);
+ if (o_ptr->timeout || j_ptr->timeout) return 0;
/* Require many identical values */
- if (o_ptr->ac != j_ptr->ac) return (0);
- if (o_ptr->dd != j_ptr->dd) return (0);
- if (o_ptr->ds != j_ptr->ds) return (0);
+ if (o_ptr->ac != j_ptr->ac) return 0;
+ if (o_ptr->dd != j_ptr->dd) return 0;
+ if (o_ptr->ds != j_ptr->ds) return 0;
/* Hack -- Never stack chests */
- if (o_ptr->tval == TV_CHEST) return (0);
- if (o_ptr->tval == TV_STATUE) return (0);
- if (o_ptr->tval == TV_CAPTURE) return (0);
+ if (o_ptr->tval == TV_CHEST) return 0;
+ if (o_ptr->tval == TV_STATUE) return 0;
+ if (o_ptr->tval == TV_CAPTURE) return 0;
/* Require matching discounts */
- if (o_ptr->discount != j_ptr->discount) return (0);
+ if (o_ptr->discount != j_ptr->discount) return 0;
/* They match, so they must be similar */
return TRUE;
/* No space? */
if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
if (st_ptr->stock_num >= st_ptr->stock_size) {
- return (-1);
+ return -1;
}
}
else{
if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
- return (-1);
+ return -1;
}
}
value = object_value(o_ptr);
/* Cursed/Worthless items "disappear" when sold */
- if (value <= 0) return (-1);
+ if (value <= 0) return -1;
/* All store items are fully *identified* */
o_ptr->ident |= IDENT_MENTAL;
}
/* No space? */
- if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
+ if (st_ptr->stock_num >= st_ptr->stock_size) return -1;
/* Check existing slots to see if we must "slide" */
{
z1 = FORCEUPPER(*s1);
z2 = FORCEUPPER(*s2);
- if (z1 < z2) return (-1);
- if (z1 > z2) return (1);
- if (!z1) return (0);
+ if (z1 < z2) return -1;
+ if (z1 > z2) return 1;
+ if (!z1) return 0;
}
}
buf[0] = '\0';
/* No file? */
- if (!file) return (-1);
+ if (!file) return -1;
/* File needs no parsing */
if (file[0] != '~')
{
(void)strnfmt(buf, max, "%s", file);
- return (0);
+ return 0;
}
/* Point at the user */
s = my_strstr(u, PATH_SEP);
/* Hack -- no long user names */
- if (s && (s >= u + sizeof(user))) return (1);
+ if (s && (s >= u + sizeof(user))) return 1;
/* Extract a user name */
if (s)
else pw = getpwuid(getuid());
/* Nothing found? */
- if (!pw) return (1);
+ if (!pw) return 1;
/* Make use of the info */
if (s) strnfmt(buf, max, "%s%s", pw->pw_dir, s);
else strnfmt(buf, max, "%s", pw->pw_dir);
/* Success */
- return (0);
+ return 0;
}
#endif /* MAC_MPW && CARBON */
/* Success */
- return (0);
+ return 0;
}
/* Temp file */
s = tmpnam(NULL);
- if (!s) return (-1);
+ if (!s) return -1;
/* Format to length */
#if !defined(WIN32) || (defined(_MSC_VER) && (_MSC_VER >= 1900))
#endif
/* Success */
- return (0);
+ return 0;
}
#endif
}
/* Success */
- return (0);
+ return 0;
}
errr my_fclose(FILE *fff)
{
/* Require a file */
- if (!fff) return (-1);
+ if (!fff) return -1;
/* Close, check for error */
- if (fclose(fff) == EOF) return (1);
+ if (fclose(fff) == EOF) return 1;
/* Success */
- return (0);
+ return 0;
}
buf[i] = '\0';
/* Success */
- return (0);
+ return 0;
}
/* Handle tabs */
buf[i] = '\0';
/* Success */
- return (0);
+ return 0;
}
/* Nothing */
buf[0] = '\0';
/* Failure */
- return (1);
+ return 1;
}
(void)fprintf(fff, "%s\n", buf);
/* Success */
- return (0);
+ return 0;
}
char buf[1024];
/* Hack -- Try to parse the path */
- if (path_parse(buf, 1024, file)) return (-1);
+ if (path_parse(buf, 1024, file)) return -1;
/* Remove */
(void)remove(buf);
- return (0);
+ return 0;
}
char aux[1024];
/* Hack -- Try to parse the path */
- if (path_parse(buf, 1024, file)) return (-1);
+ if (path_parse(buf, 1024, file)) return -1;
/* Hack -- Try to parse the path */
- if (path_parse(aux, 1024, what)) return (-1);
+ if (path_parse(aux, 1024, what)) return -1;
/* Rename */
(void)rename(buf, aux);
- return (0);
+ return 0;
}
int src_fd, dst_fd;
/* Hack -- Try to parse the path */
- if (path_parse(buf, 1024, file)) return (-1);
+ if (path_parse(buf, 1024, file)) return -1;
/* Hack -- Try to parse the path */
- if (path_parse(aux, 1024, what)) return (-1);
+ if (path_parse(aux, 1024, what)) return -1;
/* Open source file */
src_fd = fd_open(buf, O_RDONLY);
- if (src_fd < 0) return (-1);
+ if (src_fd < 0) return -1;
/* Open destination file */
dst_fd = fd_open(aux, O_WRONLY|O_TRUNC|O_CREAT);
- if (dst_fd < 0) return (-1);
+ if (dst_fd < 0) return -1;
/* Copy */
while ((read_num = read(src_fd, buf, 1024)) > 0)
fd_close(src_fd);
fd_close(dst_fd);
- return (0);
+ return 0;
}
/*
char buf[1024];
/* Hack -- Try to parse the path */
- if (path_parse(buf, 1024, file)) return (-1);
+ if (path_parse(buf, 1024, file)) return -1;
#if defined(MAC_MPW) || defined(MACH_O_CARBON)
{
char buf[1024];
/* Hack -- Try to parse the path */
- if (path_parse(buf, 1024, file)) return (-1);
+ if (path_parse(buf, 1024, file)) return -1;
/* Attempt to open the file */
return (open(buf, flags | O_BINARY, 0));
what = what ? what : 0;
/* Verify the fd */
- if (fd < 0) return (-1);
+ if (fd < 0) return -1;
#ifdef SET_UID
else
{
/* Lock the score file */
- if (lockf(fd, F_LOCK, 0) != 0) return (1);
+ if (lockf(fd, F_LOCK, 0) != 0) return 1;
}
# endif
else
{
/* Lock the score file */
- if (flock(fd, LOCK_EX) != 0) return (1);
+ if (flock(fd, LOCK_EX) != 0) return 1;
}
# endif
#endif
/* Success */
- return (0);
+ return 0;
}
huge p;
/* Verify fd */
- if (fd < 0) return (-1);
+ if (fd < 0) return -1;
/* Seek to the given position */
p = lseek(fd, n, SEEK_SET);
/* Failure */
- if (p != n) return (1);
+ if (p != n) return 1;
/* Success */
- return (0);
+ return 0;
}
n = n ? n : 0;
/* Verify the fd */
- if (fd < 0) return (-1);
+ if (fd < 0) return -1;
#if defined(ULTRIX) || defined(NeXT)
/* Truncate */
#endif
/* Success */
- return (0);
+ return 0;
}
errr fd_read(int fd, char *buf, huge n)
{
/* Verify the fd */
- if (fd < 0) return (-1);
+ if (fd < 0) return -1;
#ifndef SET_UID
while (n >= 16384)
{
/* Read a piece */
- if (read(fd, buf, 16384) != 16384) return (1);
+ if (read(fd, buf, 16384) != 16384) return 1;
/* Shorten the task */
buf += 16384;
#endif
/* Read the final piece */
- if (read(fd, buf, n) != (int)n) return (1);
+ if (read(fd, buf, n) != (int)n) return 1;
/* Success */
- return (0);
+ return 0;
}
errr fd_write(int fd, concptr buf, huge n)
{
/* Verify the fd */
- if (fd < 0) return (-1);
+ if (fd < 0) return -1;
#ifndef SET_UID
while (n >= 16384)
{
/* Write a piece */
- if (write(fd, buf, 16384) != 16384) return (1);
+ if (write(fd, buf, 16384) != 16384) return 1;
/* Shorten the task */
buf += 16384;
#endif
/* Write the final piece */
- if (write(fd, buf, n) != (int)n) return (1);
+ if (write(fd, buf, n) != (int)n) return 1;
/* Success */
- return (0);
+ return 0;
}
errr fd_close(int fd)
{
/* Verify the fd */
- if (fd < 0) return (-1);
+ if (fd < 0) return -1;
/* Close */
(void)close(fd);
- return (0);
+ return 0;
}
static int deoct(char c)
{
if (isdigit(c)) return (D2I(c));
- return (0);
+ return 0;
}
/*
if (isdigit(c)) return (D2I(c));
if (islower(c)) return (A2I(c) + 10);
if (isupper(c)) return (A2I(tolower(c)) + 10);
- return (0);
+ return 0;
}
{
z1 = FORCEUPPER(*s1);
z2 = FORCEUPPER(*s2);
- if (z1 < z2) return (-1);
- if (z1 > z2) return (1);
- if (!z1) return (0);
+ if (z1 < z2) return -1;
+ if (z1 > z2) return 1;
+ if (!z1) return 0;
}
}
{
z1 = FORCEUPPER(*s1);
z2 = FORCEUPPER(*s2);
- if (z1 < z2) return (-1);
- if (z1 > z2) return (1);
- if (!z1) return (0);
+ if (z1 < z2) return -1;
+ if (z1 > z2) return 1;
+ if (!z1) return 0;
}
return 0;
}
/* Nothing possible */
if (!macro__use[(byte)(pat[0])])
{
- return (-1);
+ return -1;
}
/* Scan the macros */
}
/* No matches */
- return (-1);
+ return -1;
}
/* Nothing possible */
if (!macro__use[(byte)(pat[0])])
{
- return (-1);
+ return -1;
}
/* Scan the macros */
}
/* Nothing */
- return (-1);
+ return -1;
}
/* Nothing possible */
if (!macro__use[(byte)(pat[0])])
{
- return (-1);
+ return -1;
}
/* Scan the macros */
}
/* Nothing */
- return (-1);
+ return -1;
}
/* Nothing possible */
if (!macro__use[(byte)(pat[0])])
{
- return (-1);
+ return -1;
}
/* Scan the macros */
/* Paranoia -- require data */
- if (!pat || !act) return (-1);
+ if (!pat || !act) return -1;
/* Look for any existing macro */
macro__use[(byte)(pat[0])] = TRUE;
/* Success */
- return (0);
+ return 0;
}
while (p > 0)
{
/* Push the key, notice over-flow */
- if (Term_key_push(buf[--p])) return (0);
+ if (Term_key_push(buf[--p])) return 0;
}
/* Wait for (and remove) a pending key */
while (p > n)
{
/* Push the key, notice over-flow */
- if (Term_key_push(buf[--p])) return (0);
+ if (Term_key_push(buf[--p])) return 0;
}
parse_macro = TRUE;
/* Push the "end of macro action" key */
- if (Term_key_push(30)) return (0);
+ if (Term_key_push(30)) return 0;
/* Access the macro action */
while (n > 0)
{
/* Push the key, notice over-flow */
- if (Term_key_push(act[--n])) return (0);
+ if (Term_key_push(act[--n])) return 0;
}
/* Hack -- Force "inkey()" to call us again */
- return (0);
+ return 0;
}
max_num = num;
/* Choose! */
- if (!get_com("Get what type of object? ", &ch, FALSE)) return (0);
+ if (!get_com("Get what type of object? ", &ch, FALSE)) return 0;
/* Analyze choice */
for (num = 0; num < max_num; num++)
}
/* Bail out if choice is illegal */
- if ((num < 0) || (num >= max_num)) return (0);
+ if ((num < 0) || (num >= max_num)) return 0;
/* Base object type chosen, fill in tval */
tval = tvals[num].tval;
max_num = num;
/* Choose! */
- if (!get_com(format("What Kind of %s? ", tval_desc), &ch, FALSE)) return (0);
+ if (!get_com(format("What Kind of %s? ", tval_desc), &ch, FALSE)) return 0;
/* Analyze choice */
for (num = 0; num < max_num; num++)
}
/* Bail out if choice is "illegal" */
- if ((num < 0) || (num >= max_num)) return (0);
+ if ((num < 0) || (num >= max_num)) return 0;
/* And return successful */
return (choice[num]);
buf[0] = '\0';
/* Return "error" */
- return (0);
+ return 0;
}
/* Error -- format sequence may be too long */
buf[0] = '\0';
/* Return "error" */
- return (0);
+ return 0;
}
/* Handle "alphabetic" chars */
buf[0] = '\0';
/* Return "error" */
- return (0);
+ return 0;
}
/* Handle normal end of format sequence */
buf[0] = '\0';
/* Return "error" */
- return (0);
+ return 0;
}
}
u32b ret;
/* Hack -- simple case */
- if (m <= 1) return (0);
+ if (m <= 1) return 0;
scaling = Rand_Xorshift_max / m;
past = scaling * m;
C_KILL(s->vtc, h * w, char);
/* Success */
- return (0);
+ return 0;
}
}
/* Success */
- return (0);
+ return 0;
}
s->cv = f->cv;
/* Success */
- return (0);
+ return 0;
}
errr Term_user(int n)
{
/* Verify the hook */
- if (!Term->user_hook) return (-1);
+ if (!Term->user_hook) return -1;
/* Call the hook */
return ((*Term->user_hook)(n));
errr Term_xtra(int n, int v)
{
/* Verify the hook */
- if (!Term->xtra_hook) return (-1);
+ if (!Term->xtra_hook) return -1;
/* Call the hook */
return ((*Term->xtra_hook)(n, v));
(void)x;
(void)y;
- return (-1);
+ return -1;
}
/*
(void)y;
(void)n;
- return (-1);
+ return -1;
}
/*
(void)a;
(void)cp;
- return (-1);
+ return -1;
}
/*
(void)tap;
(void)tcp;
- return (-1);
+ return -1;
}
term_win *scr = Term->scr;
/* Before initialize (Advice from Mr.shimitei)*/
- if (!old || !scr) return (1);
+ if (!old || !scr) return 1;
/* Do nothing unless "mapped" */
- if (!Term->mapped_flag) return (1);
+ if (!Term->mapped_flag) return 1;
/* Trivial Refresh */
!(Term->total_erase))
{
/* Nothing */
- return (1);
+ return 1;
}
/* Success */
- return (0);
+ return 0;
}
errr Term_set_cursor(int v)
{
/* Already done */
- if (Term->scr->cv == v) return (1);
+ if (Term->scr->cv == v) return 1;
/* Change */
Term->scr->cv = (bool_hack)v;
/* Success */
- return (0);
+ return 0;
}
int h = Term->hgt;
/* Verify */
- if ((x < 0) || (x >= w)) return (-1);
- if ((y < 0) || (y >= h)) return (-1);
+ if ((x < 0) || (x >= w)) return -1;
+ if ((y < 0) || (y >= h)) return -1;
/* Remember the cursor */
Term->scr->cx = (byte_hack)x;
Term->scr->cu = 0;
/* Success */
- return (0);
+ return 0;
}
int w = Term->wid;
int h = Term->hgt;
- if ((x < 0) || (x >= w)) return (-1);
- if ((y < 0) || (y >= h)) return (-1);
+ if ((x < 0) || (x >= w)) return -1;
+ if ((y < 0) || (y >= h)) return -1;
/* Paranoia -- illegal char */
if (!c) return (-2);
Term_queue_char(x, y, a, c, 0, 0);
/* Success */
- return (0);
+ return 0;
}
TERM_LEN w = Term->wid;
/* Handle "unusable" cursor */
- if (Term->scr->cu) return (-1);
+ if (Term->scr->cu) return -1;
/* Paranoia -- no illegal chars */
if (!c) return (-2);
Term->scr->cx++;
/* Success */
- if (Term->scr->cx < w) return (0);
+ if (Term->scr->cx < w) return 0;
/* Note "Useless" cursor */
Term->scr->cu = 1;
/* Note "Useless" cursor */
- return (1);
+ return 1;
}
if (!use_bigtile) return Term_addch(a, c);
/* Handle "unusable" cursor */
- if (Term->scr->cu) return (-1);
+ if (Term->scr->cu) return -1;
/* Paranoia -- no illegal chars */
if (!c) return (-2);
Term->scr->cx += 2;
/* Success */
- if (Term->scr->cx < Term->wid) return (0);
+ if (Term->scr->cx < Term->wid) return 0;
/* Note "Useless" cursor */
Term->scr->cu = 1;
/* Note "Useless" cursor */
- return (1);
+ return 1;
}
errr res = 0;
/* Handle "unusable" cursor */
- if (Term->scr->cu) return (-1);
+ if (Term->scr->cu) return -1;
/* Obtain maximal length */
k = (n < 0) ? (w + 1) : n;
if ((res = Term_addch(a, c)) != 0) return (res);
/* Success */
- return (0);
+ return 0;
}
if ((res = Term_addstr(n, a, s)) != 0) return (res);
/* Success */
- return (0);
+ return 0;
}
#ifdef JP
}
/* Success */
- return (0);
+ return 0;
}
#endif
char *scr_tcc;
/* Place cursor */
- if (Term_gotoxy(x, y)) return (-1);
+ if (Term_gotoxy(x, y)) return -1;
/* Force legal size */
if (x + n > w) n = w - x;
}
/* Success */
- return (0);
+ return 0;
}
Term->total_erase = TRUE;
/* Success */
- return (0);
+ return 0;
}
Term_fresh();
/* Success */
- return (0);
+ return 0;
}
Term_fresh();
/* Success */
- return (0);
+ return 0;
}
(*v) = Term->scr->cv;
/* Success */
- return (0);
+ return 0;
}
(*h) = Term->hgt;
/* Success */
- return (0);
+ return 0;
}
(*y) = Term->scr->cy;
/* Warn about "useless" cursor */
- if (Term->scr->cu) return (1);
+ if (Term->scr->cu) return 1;
/* Success */
- return (0);
+ return 0;
}
TERM_LEN w = Term->wid;
TERM_LEN h = Term->hgt;
- if ((x < 0) || (x >= w)) return (-1);
- if ((y < 0) || (y >= h)) return (-1);
+ if ((x < 0) || (x >= w)) return -1;
+ if ((y < 0) || (y >= h)) return -1;
/* Direct access */
(*a) = Term->scr->a[y][x];
(*c) = Term->scr->c[y][x];
/* Success */
- return (0);
+ return 0;
}
Term->key_head = Term->key_tail = 0;
/* Success */
- return (0);
+ return 0;
}
errr Term_keypress(int k)
{
/* Hack -- Refuse to enqueue non-keys */
- if (!k) return (-1);
+ if (!k) return -1;
/* Store the char, advance the queue */
Term->key_queue[Term->key_head++] = (char)k;
if (Term->key_head == Term->key_size) Term->key_head = 0;
/* Success (unless overflow) */
- if (Term->key_head != Term->key_tail) return (0);
+ if (Term->key_head != Term->key_tail) return 0;
#if 0
/* Hack -- Forget the oldest key */
#endif
/* Problem */
- return (1);
+ return 1;
}
errr Term_key_push(int k)
{
/* Hack -- Refuse to enqueue non-keys */
- if (!k) return (-1);
+ if (!k) return -1;
/* Hack -- Overflow may induce circular queue */
if (Term->key_tail == 0) Term->key_tail = Term->key_size;
Term->key_queue[--Term->key_tail] = (char)k;
/* Success (unless overflow) */
- if (Term->key_head != Term->key_tail) return (0);
+ if (Term->key_head != Term->key_tail) return 0;
/* Problem */
- return (1);
+ return 1;
}
}
/* No keys are ready */
- if (Term->key_head == Term->key_tail) return (1);
+ if (Term->key_head == Term->key_tail) return 1;
/* Extract the next keypress */
(*ch) = Term->key_queue[Term->key_tail];
if (take && (++Term->key_tail == Term->key_size)) Term->key_tail = 0;
/* Success */
- return (0);
+ return 0;
}
term_win_copy(Term->mem, Term->scr, w, h);
/* Success */
- return (0);
+ return 0;
}
Term->y2 = h - 1;
/* Success */
- return (0);
+ return 0;
}
Term->y2 = h - 1;
/* Success */
- return (0);
+ return 0;
}
term_win *hold_tmp;
/* Resizing is forbidden */
- if (Term->fixed_shape) return (-1);
+ if (Term->fixed_shape) return -1;
/* Ignore illegal changes */
- if ((w < 1) || (h < 1)) return (-1);
+ if ((w < 1) || (h < 1)) return -1;
/* Ignore non-changes */
if ((Term->wid == w) && (Term->hgt == h) && (arg_bigtile == use_bigtile))
- return (1);
+ return 1;
use_bigtile = arg_bigtile;
}
/* Success */
- return (0);
+ return 0;
}
errr Term_activate(term *t)
{
/* Hack -- already done */
- if (Term == t) return (1);
+ if (Term == t) return 1;
/* Deactivate the old Term */
if (Term) Term_xtra(TERM_XTRA_LEVEL, 0);
if (Term) Term_xtra(TERM_XTRA_LEVEL, 1);
/* Success */
- return (0);
+ return 0;
}
C_KILL(t->key_queue, t->key_size, char);
/* Success */
- return (0);
+ return 0;
}
/* Success */
- return (0);
+ return 0;
}
huge len = 0;
/* Succeed on non-strings */
- if (!str) return (0);
+ if (!str) return 0;
/* Count the number of chars in 'str' plus the terminator */
while (str[len++]) /* loop */;
(void)rnfree((vptr)(str), len);
/* Success */
- return (0);
+ return 0;
}