Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8bc01ad

Browse files
author
David Joyce
committed
Init variables outside of loop to avoid C compiler error
1 parent c98d6fb commit 8bc01ad

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/coreclr/coreutils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ void AddFilesFromDirectoryToTpaList(const char* directory, char** tpaList)
233233

234234
// Walk the directory for each extension separately so that we first get files with .ni.dll extension,
235235
// then files with .dll extension, etc.
236-
for (size_t extIndex = 0; extIndex < sizeof(tpaExtensions) / sizeof(tpaExtensions[0]); extIndex++)
236+
size_t extIndex;
237+
for (extIndex = 0; extIndex < sizeof(tpaExtensions) / sizeof(tpaExtensions[0]); extIndex++)
237238
{
238239
const char* ext = tpaExtensions[extIndex];
239240
size_t extLength = strlen(ext);

src/coreclr/pynetinit.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ void init(PyNet_Args* pn_args)
109109
const char *slash = "/";
110110
int found = 0;
111111

112-
for (int ii = 0; ii < PyList_Size(syspath); ++ii)
112+
int ii;
113+
for (ii = 0; ii < PyList_Size(syspath); ++ii)
113114
{
114115
#if PY_MAJOR_VERSION >= 3
115116
Py_ssize_t wlen;

0 commit comments

Comments
 (0)