Skip to content

Commit e44a0c8

Browse files
committed
upd project sdk
1 parent 9779dbb commit e44a0c8

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

src/main.c

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ INT CALLBACK _app_listviewcompare_callback (
295295
_In_ LPARAM lparam
296296
)
297297
{
298-
static R_STRINGREF sr1 = PR_STRINGREF_INIT (L"Windows (");
299-
298+
R_STRINGREF sr1 = PR_STRINGREF_INIT (L"Windows (");
300299
WCHAR config_name[128];
301300
PR_STRING item_text_1;
302301
PR_STRING item_text_2;
@@ -312,7 +311,7 @@ INT CALLBACK _app_listviewcompare_callback (
312311
item1 = (INT)(INT_PTR)lparam1;
313312
item2 = (INT)(INT_PTR)lparam2;
314313

315-
if (item1 == -1 || item2 == -1)
314+
if (item1 == INT_ERROR || item2 == INT_ERROR)
316315
return 0;
317316

318317
hlistview = (HWND)lparam;
@@ -379,7 +378,7 @@ VOID _app_listviewsort (
379378
if (is_notifycode)
380379
is_descend = !is_descend;
381380

382-
if (column_id == -1)
381+
if (column_id == INT_ERROR)
383382
column_id = _r_config_getlong_ex (L"SortColumn", 0, config_name);
384383

385384
column_id = _r_calc_clamp (column_id, 0, column_count - 1); // set range
@@ -480,9 +479,9 @@ VOID _app_print (
480479
severity_string = _r_obj_findhashtablepointer (config.severity, _r_math_hashinteger_ptr (severity_code));
481480
facility_string = _r_obj_findhashtablepointer (config.facility, _r_math_hashinteger_ptr (facility_code));
482481

483-
select_id = _r_config_getlong (L"SelectedItem", -1);
482+
select_id = _r_config_getlong (L"SelectedItem", INT_ERROR);
484483

485-
if (select_id == -1)
484+
if (select_id == INT_ERROR)
486485
select_id = _r_listview_getselecteditem (hwnd, IDC_LISTVIEW);
487486

488487
// clear first
@@ -529,12 +528,12 @@ VOID _app_print (
529528
}
530529
}
531530

532-
if (select_id == -1)
531+
if (select_id == INT_ERROR)
533532
select_id = 0;
534533

535534
_r_listview_setcolumn (hwnd, IDC_LISTVIEW, 0, NULL, -100);
536535

537-
_app_listviewsort (hwnd, IDC_LISTVIEW, -1, FALSE);
536+
_app_listviewsort (hwnd, IDC_LISTVIEW, INT_ERROR, FALSE);
538537

539538
// show description for first item
540539
if (item_count)
@@ -755,7 +754,7 @@ INT_PTR CALLBACK SettingsProc (
755754
_app_additemtolist (hwnd, ptr_module->full_path, module_hash, ptr_module->is_internal);
756755
}
757756

758-
_app_listviewsort (hwnd, IDC_MODULES, -1, FALSE);
757+
_app_listviewsort (hwnd, IDC_MODULES, INT_ERROR, FALSE);
759758

760759
break;
761760
}
@@ -957,10 +956,10 @@ INT_PTR CALLBACK SettingsProc (
957956

958957
lpnmlv = (LPNMITEMACTIVATE)lparam;
959958

960-
if (lpnmlv->iItem == -1)
959+
if (lpnmlv->iItem == INT_ERROR)
961960
break;
962961

963-
_r_wnd_sendmessage (hwnd, 0, WM_COMMAND, MAKEWPARAM (IDM_EXPLORE, 0), 0);
962+
_r_ctrl_sendcommand (hwnd, IDM_EXPLORE, 0);
964963

965964
break;
966965
}
@@ -1125,12 +1124,12 @@ INT_PTR CALLBACK SettingsProc (
11251124
if (!_r_listview_getselectedcount (hwnd, IDC_MODULES))
11261125
break;
11271126

1128-
if (!_r_show_confirmmessage (hwnd, NULL, _r_locale_getstring (IDS_QUESTION_DELETE), NULL))
1127+
if (!_r_show_confirmmessage (hwnd, _r_locale_getstring (IDS_QUESTION_DELETE), NULL, NULL, FALSE))
11291128
break;
11301129

11311130
item_count = _r_listview_getitemcount (hwnd, IDC_MODULES);
11321131

1133-
for (INT i = item_count - 1; i != -1; i--)
1132+
for (INT i = item_count - 1; i != INT_ERROR; i--)
11341133
{
11351134
if (!_r_listview_isitemselected (hwnd, IDC_MODULES, i))
11361135
continue;
@@ -1147,12 +1146,12 @@ INT_PTR CALLBACK SettingsProc (
11471146
case IDM_CHECK:
11481147
case IDM_UNCHECK:
11491148
{
1150-
INT item_id = -1;
1149+
INT item_id = INT_ERROR;
11511150

11521151
if (!_r_listview_getselectedcount (hwnd, IDC_MODULES))
11531152
break;
11541153

1155-
while ((item_id = _r_listview_getnextselected (hwnd, IDC_MODULES, item_id)) != -1)
1154+
while ((item_id = _r_listview_getnextselected (hwnd, IDC_MODULES, item_id)) != INT_ERROR)
11561155
{
11571156
_r_listview_setitemcheck (hwnd, IDC_MODULES, item_id, LOWORD (wparam) == IDM_CHECK ? TRUE : FALSE);
11581157
}
@@ -1163,12 +1162,12 @@ INT_PTR CALLBACK SettingsProc (
11631162
case IDM_EXPLORE:
11641163
{
11651164
ULONG_PTR module_hash;
1166-
INT item_id = -1;
1165+
INT item_id = INT_ERROR;
11671166

11681167
if (!_r_listview_getselectedcount (hwnd, IDC_MODULES))
11691168
break;
11701169

1171-
while ((item_id = _r_listview_getnextselected (hwnd, IDC_MODULES, item_id)) != -1)
1170+
while ((item_id = _r_listview_getnextselected (hwnd, IDC_MODULES, item_id)) != INT_ERROR)
11721171
{
11731172
module_hash = _r_listview_getitemlparam (hwnd, IDC_MODULES, item_id);
11741173

@@ -1182,14 +1181,14 @@ INT_PTR CALLBACK SettingsProc (
11821181
{
11831182
R_STRINGBUILDER sb;
11841183
PR_STRING string;
1185-
INT item_id = -1;
1184+
INT item_id = INT_ERROR;
11861185

11871186
if (!_r_listview_getselectedcount (hwnd, IDC_MODULES))
11881187
break;
11891188

11901189
_r_obj_initializestringbuilder (&sb, 256);
11911190

1192-
while ((item_id = _r_listview_getnextselected (hwnd, IDC_MODULES, item_id)) != -1)
1191+
while ((item_id = _r_listview_getnextselected (hwnd, IDC_MODULES, item_id)) != INT_ERROR)
11931192
{
11941193
string = _r_listview_getitemtext (hwnd, IDC_MODULES, item_id, 0);
11951194

@@ -1419,7 +1418,7 @@ INT_PTR CALLBACK DlgProc (
14191418

14201419
lpnmlv = (LPNMITEMACTIVATE)lparam;
14211420

1422-
if (!nmlp->idFrom || lpnmlv->iItem == -1 || nmlp->idFrom != IDC_LISTVIEW)
1421+
if (!nmlp->idFrom || lpnmlv->iItem == INT_ERROR || nmlp->idFrom != IDC_LISTVIEW)
14231422
break;
14241423

14251424
// localize
@@ -1459,10 +1458,10 @@ INT_PTR CALLBACK DlgProc (
14591458

14601459
lpnmlv = (LPNMITEMACTIVATE)lparam;
14611460

1462-
if (lpnmlv->iItem == -1)
1461+
if (lpnmlv->iItem == INT_ERROR)
14631462
break;
14641463

1465-
_r_wnd_sendmessage (hwnd, 0, WM_COMMAND, MAKEWPARAM (IDM_EXPLORE, 0), 0);
1464+
_r_ctrl_sendcommand (hwnd, IDM_EXPLORE, 0);
14661465

14671466
break;
14681467
}
@@ -1478,7 +1477,7 @@ INT_PTR CALLBACK DlgProc (
14781477

14791478
lpnmlv = (LPNMITEMACTIVATE)lparam;
14801479

1481-
if (lpnmlv->iItem != -1)
1480+
if (lpnmlv->iItem != INT_ERROR)
14821481
{
14831482
module_hash = _r_listview_getitemlparam (hwnd, IDC_LISTVIEW, lpnmlv->iItem);
14841483

@@ -1727,7 +1726,7 @@ INT_PTR CALLBACK DlgProc (
17271726

17281727
item_id = _r_listview_getselecteditem (hwnd, IDC_LISTVIEW);
17291728

1730-
if (item_id == -1)
1729+
if (item_id == INT_ERROR)
17311730
break;
17321731

17331732
module_hash = _r_listview_getitemlparam (hwnd, IDC_LISTVIEW, item_id);
@@ -1744,7 +1743,7 @@ INT_PTR CALLBACK DlgProc (
17441743

17451744
item_id = _r_listview_getselecteditem (hwnd, IDC_LISTVIEW);
17461745

1747-
if (item_id == -1)
1746+
if (item_id == INT_ERROR)
17481747
break;
17491748

17501749
string = _r_listview_getitemtext (hwnd, IDC_LISTVIEW, item_id, 0);

0 commit comments

Comments
 (0)