[Webkit-unassigned] [Bug 19299] QTMovieWin should not hard code supported MIME types

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 29 09:51:21 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=19299





------- Comment #3 from koivisto at iki.fi  2008-05-29 09:51 PDT -------
Looks good. Some style comments, I guess this was adapted from existing code. 

+    ComponentDescription    findCD;
+    QTAtom                  mimeTag;
+    Component               comp;
+    char                    *atomData;
+    int                     index;
+    long                    componentCount;
+    OSErr                   err = noErr;

+                QTAtomContainer         mimeList = NULL;
+                ComponentDescription    infoCD;
+                int                     typeIndex, typeCount;
+                long                    typeLength;

WebKit code doesn't usually align variable names like this.

+                // grab every type from the container
+                QTLockContainer(mimeList);
+                typeCount = QTCountChildrenOfType(mimeList,
kParentAtomIsContainer, kMimeInfoMimeTypeTag);
+                for (typeIndex = 1; typeIndex <= typeCount; typeIndex++) {
+                    if ( 0 != (mimeTag = QTFindChildByIndex(mimeList, 0,
kMimeInfoMimeTypeTag, typeIndex, NULL))) {

Extra space after (
It would be better to do assignment separately from comparison.
This and the next if could use continue instead, reducing code nesting.

+                            if (0 != strncmp(typeBuffer, "audio/", 6) && 0 !=
strncmp(typeBuffer, "video/", 6))

0 != is unnecessary

+                            for ( int addedIndex = 0; addedIndex <
gSupportedTypes->size(); addedIndex++ ) {

extra space after ( and before  )


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list