Ticket #886: tt_886_win.patch
File tt_886_win.patch, 2.7 KB (added by jimmy, 12 years ago) |
---|
-
src/io/socket_win32.c
77 77 Parrot_io_socket_win32(PARROT_INTERP, ARGIN(PMC * s), int fam, int type, int proto) 78 78 { 79 79 ASSERT_ARGS(Parrot_io_socket_win32) 80 int sock, i= 1;81 sock = socket(fam, type, proto);80 int i = 1; 81 const int sock = socket(fam, type, proto); 82 82 if (sock >= 0) { 83 83 setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char*)&i, sizeof (i)); 84 84 Parrot_io_set_os_handle(interp, s, sock); … … 443 443 Parrot_io_sockaddr_in(PARROT_INTERP, ARGIN(STRING *addr), INTVAL port) 444 444 { 445 445 ASSERT_ARGS(Parrot_io_sockaddr_in) 446 PMC * sockaddr; 447 char * s; 448 449 s = Parrot_str_to_cstring(interp, addr); 446 PMC * sockaddr; 447 char * const s = Parrot_str_to_cstring(interp, addr); 450 448 sockaddr = pmc_new(interp, enum_class_Sockaddr); 451 449 get_sockaddr_in(interp, sockaddr, s, port); 452 450 Parrot_str_free_cstring(s); -
src/io/win32.c
701 701 NULL, NULL, TRUE, 0, 702 702 NULL, NULL, &start, &procinfo) == 0) 703 703 goto fail; 704 Parrot_str_free_cstring(cmd);705 cmd = NULL;706 704 if (f_read) { 707 705 Parrot_io_set_os_handle(interp, io, hread); 708 706 CloseHandle(hwrite); … … 711 709 Parrot_io_set_os_handle(interp, io, hwrite); 712 710 CloseHandle(hread); 713 711 } 712 713 Parrot_str_free_cstring(cmd); 714 714 CloseHandle(procinfo.hThread); 715 715 VTABLE_set_integer_keyed_int(interp, io, 0, (INTVAL)procinfo.hProcess); 716 716 return io; -
src/pmc/string.pmc
52 52 53 53 VTABLE void mark() { 54 54 STRING *str_val; 55 56 if (!PMC_data(SELF)) 57 return; 58 55 59 GET_ATTR_str_val(INTERP, SELF, str_val); 56 60 Parrot_gc_mark_STRING_alive(INTERP, str_val); 57 61 } … … 202 206 203 207 /* Only allow constant PMCs to embed constant strings */ 204 208 if (PObj_constant_TEST(SELF) && !PObj_constant_TEST(value)) { 205 char * copy = Parrot_str_to_cstring(INTERP, value);206 value = Parrot_str_new_init(INTERP, copy, strlen(copy),209 char * const copy = Parrot_str_to_cstring(INTERP, value); 210 value = Parrot_str_new_init(INTERP, copy, strlen(copy), 207 211 PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET, 208 212 PObj_constant_FLAG); 209 213 Parrot_str_free_cstring(copy);