npunix.c is missing lots of function pointer copying and will break with older browsers

RESOLVED FIXED

Status

()

RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: wbardwel, Assigned: wbardwel)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

12 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060211 Fedora/1.0.7-1.3.fc3.legacy Firefox/1.0.7
Build Identifier: 

modules/plugin/samples/default/unix/npunix.c has various dependancies that mean that plugins built with it won't work with older browsers, and it doesn't actually copy most of the function pointers for the new functions added to the Mozilla version of the Netscape API.  Basically it is totally unusable.

Reproducible: Always

Steps to Reproduce:
1.Make a plugin using npunix.c
2.
3.



Expected Results:  
The function pointer copying code should try to copy all pointers that are actually there, no more, no less.

See also [Bug 359722]
(Assignee)

Comment 1

12 years ago
Created attachment 245128 [details] [diff] [review]
My patch to make the file usable and have it support all of the new functions.
Attachment #245128 - Flags: review?(jst)
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 2

12 years ago
Created attachment 245259 [details] [diff] [review]
Revised patch that includes definitions of a bunch of the new NPN_ calls
Comment on attachment 245259 [details] [diff] [review]
Revised patch that includes definitions of a bunch of the new NPN_ calls

r+sr=jst
Attachment #245259 - Flags: superreview+
Attachment #245259 - Flags: review+
Whiteboard: [checkin needed]

Comment 4

12 years ago
I take it the first patch is obsoleted by the second? Please mark it as such if so.
Assignee: nobody → wbardwel

Comment 5

12 years ago
Checked in the second patch:
mozilla/modules/plugin/samples/default/unix/npunix.c  1.12
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]

Comment 6

12 years ago
So you didn't compile this apparently:

http://tinderbox.mozilla.org/showlog.cgi?log=MozillaTest/1171738500.1171741196.28976.gz

Building deps for npunix.c
cc -o npunix.o -c  -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DBUILD_ID=0000000000  -I../../../../../dist/include/java -I../../../../../dist/include   -I../../../../../dist/include/plugin -I../../../../../dist/include/nspr  -DMOZ_PNG_READ -DMOZ_PNG_WRITE  -I../../../../../dist/sdk/include    -KPIC  -xlibmil -xstrconst -xbuiltin=%all -mt  -DNDEBUG -DTRIMMED -xO4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include     -DMOZILLA_VERSION=\"1.9a3pre\" -DMOZILLA_VERSION_U=1.9a3pre -DSOLARIS=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DD_INO=d_ino -DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_SIGINFO_T=1 -DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_INT64_T=1 -DHAVE_UINT=1 -DHAVE_UINT_T=1 -DHAVE_UINT16_T=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_BYTEORDER_H=1 -DHAVE_GETOPT_H=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_NL_TYPES_H=1 -DHAVE_MALLOC_H=1 -DHAVE_X11_XKBLIB_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_LIBM=1 -DHAVE_LIBDL=1 -DHAVE_LIBSOCKET=1 -DFUNCPROTO=15 -DHAVE_XSHM=1 -D_REENTRANT=1 -DHAVE_RANDOM=1 -DHAVE_STRERROR=1 -DHAVE_LCHOWN=1 -DHAVE_FCHMOD=1 -DHAVE_SNPRINTF=1 -DHAVE_MEMMOVE=1 -DHAVE_RINT=1 -DHAVE_STAT64=1 -DHAVE_LSTAT64=1 -DHAVE_FLOCKFILE=1 -DHAVE_LOCALTIME_R=1 -DHAVE_STRTOK_R=1 -DHAVE_LANGINFO_CODESET=1 -DVA_COPY=va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JS_THREADSAFE=1 -DMOZ_ACCESSIBILITY_ATK=1 -DATK_MAJOR_VERSION=1 -DATK_MINOR_VERSION=12 -DATK_REV_VERSION=3 -DMOZILLA_LOCALE_VERSION=\"1.9a1\" -DMOZILLA_REGION_VERSION=\"1.9a1\" -DMOZILLA_SKIN_VERSION=\"1.8\"  -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT npunix.c
"npunix.c", line 263: void function cannot return value
"npunix.c", line 302: void function cannot return value
"npunix.c", line 552: warning: pointer to void or function used in arithmetic
"npunix.c", line 590: warning: pointer to void or function used in arithmetic
"npunix.c", line 640: warning: pointer to void or function used in arithmetic
cc: acomp failed for npunix.c


I checked in the following which will hopefully fix the bustage, but please build with this patch and test if it's correct (I don't know this code to check the correctness):

cvs diff: Diffing .
Index: npunix.c
===================================================================
RCS file: /cvsroot/mozilla/modules/plugin/samples/default/unix/npunix.c,v
retrieving revision 1.12
diff -u -p -r1.12 npunix.c
--- npunix.c    17 Feb 2007 18:33:50 -0000      1.12
+++ npunix.c    17 Feb 2007 21:21:01 -0000
@@ -260,7 +260,7 @@ NPIdentifier NPN_GetStringIdentifier(con
 void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount,
                               NPIdentifier *identifiers)
 {
-    return CallNPN_GetStringIdentifiersProc(gNetscapeFuncs.getstringidentifiers,
+    CallNPN_GetStringIdentifiersProc(gNetscapeFuncs.getstringidentifiers,
         names, nameCount, identifiers);
 }
 
@@ -299,7 +299,7 @@ NPObject *NPN_RetainObject(NPObject *obj
 
 void NPN_ReleaseObject(NPObject *obj)
 {
-    return CallNPN_ReleaseObjectProc(gNetscapeFuncs.releaseobject, obj);
+    CallNPN_ReleaseObjectProc(gNetscapeFuncs.releaseobject, obj);
 }
 
 bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
Attachment #245128 - Attachment is obsolete: true
Attachment #245128 - Flags: review?(jst)
You need to log in before you can comment on or make changes to this bug.