Closed Bug 303657 Opened 19 years ago Closed 13 years ago

cleaning up, const-ifying modules/libreg/src/reg.c

Categories

(Core :: XPCOM, defect)

Other
All
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mi+mozilla, Unassigned)

References

Details

(Whiteboard: [CLOSEME 2012-01-01])

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (compatible; Konqueror/3.4; FreeBSD; X11; amd64) KHTML/3.4.1 (like Gecko)
Build Identifier: 

The file arouse a lot of warnings, especially when compiled on amd64. I'm 
attaching the patch, which cleans and constifies it. 

Reproducible: Always
Attached patch the proposed patch (obsolete) — Splinter Review
The return type and the local variables of nr_GetFileLength() ought to be off_t
or, at least, long to allow it to operate on files larger than 4Gb. Not sure,
who would need a registry this large, but what do I know :-)
Attachment #191781 - Attachment is obsolete: true
I don't know if you know yet :), but normally you have to request review from a
person to look at the patch. Though i'm not sure which one to pick here...
=Though i'm not sure which one to pick here... 
 
Which person, or which patch to pick? The first patch is obsoleted  by the 
second. 
 
I don't know anyone here, but the report is assigned to Doug T. Presumably, 
he'll review my patch as soon as he has time for it... But I'll welcome 
anyone's comments... 
(In reply to comment #4)
> I don't know anyone here, but the report is assigned to Doug T. Presumably, 
> he'll review my patch as soon as he has time for it...  

See http://www.mozilla.org/owners.html for Module Owners/Peers, it seems that
http://www.mozilla.org/owners.html#registry is the right Module for this bug.
To be honest, some people get so much bugmail that it is likely that they won't
see your patch. I'll set some review flag for you, hope it's ok.
Attachment #191783 - Flags: review?(dveditz)
Status: UNCONFIRMED → NEW
Ever confirmed: true
dveditz, ping?
Comment on attachment 191783 [details] [diff] [review]
one more potential problem fixed

For the next patch it would help reviewing if you used more lines of context and used the -p option to add hints to which routine the change is in.

This doesn't build on windows because fseeko and ftello don't exist.

>         readlen = XP_FileRead(buffer, len, fh );
>         /* PR_READ() returns an unreliable length, check EOF separately */
>+#if !defined(USE_STDIO_MODES) /* USE_STDIO_MODES means XP_FileRead = fread */
>         if (readlen < 0) {

By redefining readlen as size_t this test doesn't make sense, but PR_Read uses -1 an error when USE_NSPR_MODES is true. This section would be clearer #if defined(USE_NSPR_MODES) rather than the negation of the other, btw.

>-static REGERR nr_WriteFile(FILEHANDLE fh, REGOFF offset, int32 len, void *buffer)
>+static REGERR nr_WriteFile(FILEHANDLE fh, REGOFF offset, size_t len, const void *buffer)
>-    if ((int32)XP_FileWrite(buffer, len, fh) != len)
>+    if (XP_FileWrite(buffer, len, fh) != len)

Likewise USE_NSPR_MODES does use int32. Maybe instead of swapping problems by using size_t you should add a #define type to the various vr_stubs.h sections.

r-
Attachment #191783 - Flags: review?(dveditz) → review-
Asa, Mikhail says he can't update this patch because you disabled his Bugzilla access at some point... Should someone else pick this up, or can you reenable his Bugzilla access?
I think, this file should be split into clean OS-specific ones. The #ifdef spaghetti is just too much to have another look :-(
mass reassigning to nobody.
Assignee: dougt → nobody
Component: XPCOM Registry → XPCOM
QA Contact: xpcom
This is probably not needed after bug 679352.
Depends on: 679352
Whiteboard: [CLOSEME 2012-01-01]
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: