Closed
Bug 276170
Opened 20 years ago
Closed 20 years ago
unused variable addrp in ptio.c
Categories
(NSPR :: NSPR, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
4.6
People
(Reporter: timeless, Assigned: wtc)
References
()
Details
Attachments
(2 files)
1.20 KB,
patch
|
wtc
:
review+
|
Details | Diff | Splinter Review |
2.73 KB,
patch
|
timeless
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
/Users/timeless/mozilla/nsprpub/pr/src/pthreads/ptio.c: In function `pt_Connect':
/Users/timeless/mozilla/nsprpub/pr/src/pthreads/ptio.c:1560: warning: unused
variable `addrp'
/Users/timeless/mozilla/nsprpub/pr/src/pthreads/ptio.c: In function `pt_Bind':
/Users/timeless/mozilla/nsprpub/pr/src/pthreads/ptio.c:1745: warning: unused
variable `addrp'
/Users/timeless/mozilla/nsprpub/pr/src/pthreads/ptio.c: In function `pt_SendTo':
/Users/timeless/mozilla/nsprpub/pr/src/pthreads/ptio.c:1995: warning: unused
variable `addrp'
Attachment #169678 -
Flags: review?(wtchang)
Assignee | ||
Comment 2•20 years ago
|
||
Comment on attachment 169678 [details] [diff] [review]
only declare variable if it's going to be used
r=wtc. I'll see if there is a better fix.
Thanks for the patch.
Attachment #169678 -
Flags: review?(wtchang) → review+
Assignee | ||
Comment 3•20 years ago
|
||
The strategy of this fix is to use 'addrp' where
it is not being used now, so it is never an unused
variable.
I also found that the current code has a bug
(introduced when 'addrp' was added in rev. 3.42.4.4
on the NSPRPUB_RELEASE_4_0_BRANCH, which was carried
over to the trunk in rev. 3.43) in pt_Connect and
pt_SendTo when it is setting up the pt_Continuation
structure. Using pt_Connect as an example:
#ifdef _PR_HAVE_SOCKADDR_LEN
op.arg2.buffer = (void*)&addrCopy;
#else
op.arg2.buffer = (void*)addr;
#endif
We should use 'addrp' instead of 'addr' in the #else
case. This patch also fixes this problem.
Attachment #170197 -
Flags: superreview?(darin)
Attachment #170197 -
Flags: review?(timeless)
![]() |
||
Updated•20 years ago
|
Attachment #170197 -
Flags: superreview?(darin) → superreview+
Attachment #170197 -
Flags: review?(timeless) → review+
Assignee | ||
Comment 4•20 years ago
|
||
I checked in the alternate patch on the NSPR trunk (NSPR 4.6)
and NSPRPUB_PRE_4_2_CLIENT_BRANCH (Mozilla 1.8 Alpha 6).
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.6
You need to log in
before you can comment on or make changes to this bug.
Description
•