/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* of the indices up to B115200 fit nicely in a 'short', allowing us to retain
* ospeed's type for compatibility.
*/
-#if NCURSES_OSPEED_COMPAT && ((defined(__FreeBSD__) && (__FreeBSD_version < 700000)) || defined(__NetBSD__) || defined(__OpenBSD__))
+#if NCURSES_OSPEED_COMPAT && ((defined(__FreeBSD__) && (__FreeBSD_version < 700000)) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__))
#undef B0
#undef B50
#undef B75
#undef USE_OLD_TTY
#endif /* USE_OLD_TTY */
-MODULE_ID("$Id: lib_baudrate.c,v 1.35 2014/04/26 18:48:19 juergen Exp $")
+MODULE_ID("$Id: lib_baudrate.c,v 1.38 2016/05/28 23:22:52 tom Exp $")
/*
* int
#endif
int result = ERR;
- unsigned i;
#if !USE_REENTRANT
if (OSpeed == last_OSpeed) {
#endif
if (result == ERR) {
if (OSpeed >= 0) {
+ unsigned i;
+
for (i = 0; i < SIZEOF(speeds); i++) {
- if (speeds[i].s == OSpeed) {
+ if ((int) speeds[i].s == OSpeed) {
result = speeds[i].sp;
break;
}
_nc_ospeed(int BaudRate)
{
int result = 1;
- unsigned i;
if (BaudRate >= 0) {
+ unsigned i;
+
for (i = 0; i < SIZEOF(speeds); i++) {
if (speeds[i].sp == BaudRate) {
result = speeds[i].s;