Last Comment Bug 530290 - Replace PR_MIN/PR_MAX with NS_MIN/NS_MAX in netwerk/
: Replace PR_MIN/PR_MAX with NS_MIN/NS_MAX in netwerk/
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Networking (show other bugs)
: Trunk
: All All
: -- minor (vote)
: ---
Assigned To: Jae-Seong Lee-Russo
:
Mentors:
Depends on:
Blocks: 518502
  Show dependency treegraph
 
Reported: 2009-11-21 05:47 PST by Jae-Seong Lee-Russo
Modified: 2011-07-06 15:50 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Search&Replace, 0 (31.72 KB, patch)
2009-11-21 05:50 PST, Jae-Seong Lee-Russo
cbiesinger: review-
Details | Diff | Splinter Review
Search&Replace, 1, comment #2, [check-in needed] (31.63 KB, patch)
2009-11-21 06:19 PST, Jae-Seong Lee-Russo
cbiesinger: review+
Details | Diff | Splinter Review
Search&Replace, 0 (gnomevfs), [check-in needed] (827 bytes, patch)
2009-11-22 07:34 PST, Jae-Seong Lee-Russo
cbiesinger: review+
Details | Diff | Splinter Review

Description Jae-Seong Lee-Russo 2009-11-21 05:47:51 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20091120 Minefield/3.7a1pre (.NET CLR 3.5.30729)
Build Identifier: 

Please see Bug #512106.

Reproducible: Always
Comment 1 Jae-Seong Lee-Russo 2009-11-21 05:50:35 PST
Created attachment 413805 [details] [diff] [review]
Search&Replace, 0
Comment 2 Christian :Biesinger (don't email me, ping me on IRC) 2009-11-21 06:07:45 PST
Comment on attachment 413805 [details] [diff] [review]
Search&Replace, 0

+++ b/netwerk/base/src/nsStandardURL.cpp
+    result.SetCapacity(mSpec.Length() + NS_MIN
+                       ((nsACString_internal::size_type)32, mSpec.Length()/10));

remove the _internal part

if you put the first argument on the same line as the NS_MIN, does it still fit into 80 characters?

Can you use a constructor-style cast here?

+++ b/netwerk/protocol/http/src/nsHttpChannel.cpp
+    mRedirectionLimit = NS_MIN(value, (PRUint32)0xff);

use NS_MIN(value, PRUint32(0xff))

alternatively, would 0xffU work?

+++ b/netwerk/protocol/http/src/nsHttpTransaction.cpp
+        char *p = LocateHttpStart(buf, NS_MIN(count, (PRUint32)8));

same

+++ b/netwerk/streamconv/converters/nsBinHexDecoder.cpp
+      aStream->Read(mDataBuffer, NS_MIN(aCount, (PRUint32)DATA_BUFFER_SIZE - 1), &numBytesRead);

same

also, this line is too long, please break at 80 characters

+++ b/netwerk/streamconv/converters/nsIndexedToHTML.cpp
+            description.Truncate(NS_MIN((nsAString_internal::size_type)71, description.Length() - 28));

same (cast-style and line length)
Comment 3 Jae-Seong Lee-Russo 2009-11-21 06:19:14 PST
Created attachment 413808 [details] [diff] [review]
Search&Replace, 1, comment #2, [check-in needed]
Comment 4 Jae-Seong Lee-Russo 2009-11-22 07:34:23 PST
Created attachment 413917 [details] [diff] [review]
Search&Replace, 0 (gnomevfs), [check-in needed]
Comment 5 Phil Ringnalda (:philor, back in August) 2009-12-12 15:52:35 PST
nsAboutCacheEntry.cpp
/Users/philor/mc/mozilla/netwerk/protocol/about/src/nsAboutCacheEntry.cpp: In member function ‘nsresult nsAboutCacheEntry::WriteCacheEntryDescription(nsIOutputStream*, nsICacheEntryDescriptor*)’:
/Users/philor/mc/mozilla/netwerk/protocol/about/src/nsAboutCacheEntry.cpp:392: error: no matching function for call to ‘NS_MIN(PRUint32&, long unsigned int)’
make[7]: *** [nsAboutCacheEntry.o] Error 1
Comment 6 Phil Ringnalda (:philor, back in August) 2009-12-12 21:55:45 PST
And, eventually...

nsGnomeVFSProtocolHandler.cpp
/tools/gcc-4.3.3/installed/bin/g++ -o nsGnomeVFSProtocolHandler.o -c -I../../dist/system_wrappers -include /builds/slave/sendchange-linux-unittest/mozilla/config/gcc_hidden.h -DOSTYPE=\"Linux2.6.18-53.1.19\" -DOSARCH=Linux -pthread -DORBIT2=1 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gnome-vfs-module-2.0   -I/builds/slave/sendchange-linux-unittest/mozilla/extensions/gnomevfs -I. -I../../dist/include -I../../dist/include/nsprpub  -I/builds/slave/sendchange-linux-unittest/mozilla/objdir/dist/include/nspr -I/builds/slave/sendchange-linux-unittest/mozilla/objdir/dist/include/nss       -fPIC  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Wno-long-long -pedantic -gstabs+ -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fno-reorder-functions    -DMOZILLA_CLIENT -include ../../mozilla-config.h -Wp,-MD,.deps/nsGnomeVFSProtocolHandler.pp /builds/slave/sendchange-linux-unittest/mozilla/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
/builds/slave/sendchange-linux-unittest/mozilla/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp: In member function ‘GnomeVFSResult nsGnomeVFSInputStream::DoRead(char*, PRUint32, PRUint32*)’:
/builds/slave/sendchange-linux-unittest/mozilla/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp:526: error: ‘NS_MIN’ was not declared in this scope
Comment 7 Ed Morley [:emorley] 2011-07-06 15:50:31 PDT
Fixed by bug 661584.

Note You need to log in before you can comment on or make changes to this bug.