Re: svn commit: r228878 - head/include

2011-12-30 Thread Sean C. Farley

On Fri, 30 Dec 2011, Ed Schouten wrote:


Hello Sean,

* Sean C. Farley , 20111230 03:54:

I just thought of this while reviewing the change:  should
__bool_true_false_are_defined be set only if __cplusplus is not set?
It should be set for C99, but I wonder if it should be set for C++.


Even if the C++ standard doesn't mention it at all, I think it doesn't
mean it is forbidden to define it. It starts with __[a-z], so it is in
the reserved namespace.


I am fine with it.  I found many variations of stdbool.h with some 
wrapping __bool_true_false_are_defined within the __cplusplus check 
(e.g., glibc) and some that did not.  glibc may have it because 
stdbool.h is included from cstdbool and stdbool.h in 
/usr/include/c++/4.2/tr1/.



Also, is there a style requirement that the guard for a header file
be based off of the name of the file?  I did not see anything obvious
for this within style(9), but I am curious.


I am not aware of this.


I am not aware of it either, hence, my question.  It was just something 
to which I have grown accustomed.  Using __bool_true_false_are_defined 
as the guard works.


Sean
--
s...@freebsd.org
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r228878 - head/include

2011-12-30 Thread Sean C. Farley

On Thu, 29 Dec 2011, m...@freebsd.org wrote:


On Thu, Dec 29, 2011 at 6:54 PM, Sean C. Farley  wrote:

On Sun, 25 Dec 2011, Ed Schouten wrote:


Author: ed
Date: Sun Dec 25 20:15:41 2011
New Revision: 228878
URL: http://svn.freebsd.org/changeset/base/228878

Log:
 Remove unneeded guard.

 There is no reason why  needs an include guard. It is already
 protected by __bool_true_false_are_defined.

Modified:
 head/include/stdbool.h

Modified: head/include/stdbool.h

==
--- head/include/stdbool.h      Sun Dec 25 18:15:31 2011        (r228877)
+++ head/include/stdbool.h      Sun Dec 25 20:15:41 2011        (r228878)
@@ -26,9 +26,6 @@
 * $FreeBSD$
 */

-#ifndef _STDBOOL_H_
-#define        _STDBOOL_H_
-
#ifndef __bool_true_false_are_defined
#define __bool_true_false_are_defined   1

@@ -44,5 +41,3 @@ typedef       int     _Bool;

#endif /* !__cplusplus */
#endif /* __bool_true_false_are_defined */
-
-#endif /* !_STDBOOL_H_ */



I just thought of this while reviewing the change:  should 
__bool_true_false_are_defined be set only if __cplusplus is not set? 
It should be set for C99, but I wonder if it should be set for C++.


My quick googling didn't show anything at all about the C++ standard 
and stdbool.h or __bool_true_false_are_defined.  It was probably 
originally set because bool, true, and false are all C++ keywords so 
certain code that wanted to ifdef on them didn't also need to check 
__cplusplus.


I did not find anything definitive either.

Also, is there a style requirement that the guard for a header file 
be based off of the name of the file?  I did not see anything obvious 
for this within style(9), but I am curious.


I think it's just common use to make sure different headers use a 
different include guard, so they only protect their contents, not any 
other file's.  The C standard only mentions the symbols bool, true, 
false, and __bool_true_false_are_defined in regards to stdbool.h.


Thank you.  I asked since I have only really noticed filename-based 
guards in the tree although not all are this way (i.e., bsdxml.h uses 
Expat_INCLUDED).


Sean
--
s...@freebsd.org___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r228878 - head/include

2011-12-29 Thread Sean C. Farley

On Sun, 25 Dec 2011, Ed Schouten wrote:


Author: ed
Date: Sun Dec 25 20:15:41 2011
New Revision: 228878
URL: http://svn.freebsd.org/changeset/base/228878

Log:
 Remove unneeded guard.

 There is no reason why  needs an include guard. It is already
 protected by __bool_true_false_are_defined.

Modified:
 head/include/stdbool.h

Modified: head/include/stdbool.h
==
--- head/include/stdbool.h  Sun Dec 25 18:15:31 2011(r228877)
+++ head/include/stdbool.h  Sun Dec 25 20:15:41 2011(r228878)
@@ -26,9 +26,6 @@
 * $FreeBSD$
 */

-#ifndef _STDBOOL_H_
-#define_STDBOOL_H_
-
#ifndef __bool_true_false_are_defined
#define __bool_true_false_are_defined   1

@@ -44,5 +41,3 @@ typedef   int _Bool;

#endif /* !__cplusplus */
#endif /* __bool_true_false_are_defined */
-
-#endif /* !_STDBOOL_H_ */


I just thought of this while reviewing the change:  should 
__bool_true_false_are_defined be set only if __cplusplus is not set?  It 
should be set for C99, but I wonder if it should be set for C++.


Also, is there a style requirement that the guard for a header file be 
based off of the name of the file?  I did not see anything obvious for 
this within style(9), but I am curious.


Sean
--
s...@freebsd.org
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r226614 - head/share/man/man9

2011-10-21 Thread Sean C. Farley

On Fri, 21 Oct 2011, Doug Barton wrote:


On 10/21/2011 06:54, Gleb Smirnoff wrote:

+It is not possible to guard allocations that really expect 
theirselves to be


s/theirselves/themselves/  Running this through aspell should have 
caught this. :)


ispell says it is OK.  It is in /usr/share/dict/web2.

Of course, "themselves" is much more commonly used while "theirselves" 
appears to be more logical[1].  :)


Sean
  1. http://color-connection.com/EngVW/Lessons/lesson1.htm
--
s...@freebsd.org
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r224903 - head/lib/libusb

2011-08-19 Thread Sean C. Farley

On Tue, 16 Aug 2011, Hans Petter Selasky wrote:


Author: hselasky
Date: Tue Aug 16 08:34:16 2011
New Revision: 224903
URL: http://svn.freebsd.org/changeset/base/224903

Log:
 Add missing function to get device speed to the LibUSB v1.0 API.

 MFC after: 1 week
 Approved by:   re (kib)

Modified:
 head/lib/libusb/libusb.h
 head/lib/libusb/libusb10.c

Modified: head/lib/libusb/libusb.h
==
--- head/lib/libusb/libusb.hTue Aug 16 06:26:51 2011(r224902)
+++ head/lib/libusb/libusb.hTue Aug 16 08:34:16 2011(r224903)
@@ -151,6 +151,14 @@ enum libusb_error {
LIBUSB_ERROR_OTHER = -99,
};

+enum libusb_speed {
+   LIBUSB_SPEED_UNKNOWN = 0,
+   LIBUSB_SPEED_LOW = 1,
+   LIBUSB_SPEED_FULL = 2,
+   LIBUSB_SPEED_HIGH = 3,
+   LIBUSB_SPEED_SUPER = 4,
+};
+


*snip*


+enum libusb_speed
+libusb_get_device_speed(libusb_device *dev)
+{
+   if (dev == NULL)
+   return (0); /* should not happen */


Should that return LIBUSB_SPEED_UNKNOWN instead of 0?

Sean
--
s...@freebsd.org
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r216813 - head/sys/compat/linux

2011-01-05 Thread Sean C. Farley

On Sun, 2 Jan 2011, Alexander Best wrote:


On Thu Dec 30 10, Sean Farley wrote:

Author: scf
Date: Thu Dec 30 02:18:04 2010
New Revision: 216813
URL: http://svn.freebsd.org/changeset/base/216813

Log:
  Fix the LINUX_SOUND_MIXER_INFO ioctl to return success after the
  information is set to FreeBSD.  It had been falling through to the end
  of linux_ioctl_sound() and returning ENOIOCTL.  Noticed when running the
  Linux ALSA amixer tool.

  Add a LINUX_SOUND_MIXER_READ_CAPS ioctl which is used by the Skype
  v2.1.0.81 binary.


i'm running r216877 and still skype won't detect my audio devices 
(i.e. it reports "Problem With Audio Playback").


this is with the static skype binary package.


I forgot to mention that the change is only effective using the secret 
decoder ring.  :)


Here[1] is the E-mail I sent previously to emulation@ which details what 
is necessary to get sound output working in Skype and input in arecord. 
I have not figured out how to get Skype to work with the microphone, at 
least on my system.


I wish Skype would bring back the OSS capability.

Sean
  1. 
http://lists.freebsd.org/pipermail/freebsd-emulation/2010-September/008085.html
--
s...@freebsd.org
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"