Fix dlist compilation with NDEBUG flag

minor: Fix dlist compilation with NDEBUG flag

--- src/util/dlist/dlist_debug.c
+++ src/util/dlist/dlist_debug.c
@@ -13,6 +13,7 @@

 #if DLIST_DEBUG_VERSION
 void __dlist_debug_check(const struct dlist_head *head) {
+#ifndef NDEBUG
 	const struct dlist_head *p = head->prev;
 	const struct dlist_head *n = head->next;
 	uintptr_t poison = head->poison;
@@ -27,5 +28,6 @@
 			head, (void *)poison, (void *) ~poison,
 			n, n->prev,
 			p, p->next);
+#endif
 }
 #endif

<|original_code|>
/**
 * @file
 * @brief Paranoia checks of doubly-linked lists
 *
 * @date 05.12.2013
 * @author Eldar Abusalimov
 */
#include <inttypes.h>
#include <assert.h>

#include <util/dlist.h>

#if DLIST_DEBUG_VERSION
void __dlist_debug_check(const struct dlist_head *head) {
	const struct dlist_head *p = head->prev;
	const struct dlist_head *n = head->next;
	uintptr_t poison = head->poison;

	assertf(((!poison || (void *) ~poison == head) &&
			n->prev == head &&
			p->next == head),
			"\n"
			"head: %p, poison: %p, ~poison: %p,\n"
			"n: %p, n->prev: %p,\n"
			"p: %p, p->next: %p\n",
			head, (void *)poison, (void *) ~poison,
			n, n->prev,
			p, p->next);
}
#endif

<|edits_diff|>
--- src/util/dlist/dlist_debug.c
+++ src/util/dlist/dlist_debug.c
@@ -13,6 +13,7 @@

 #if DLIST_DEBUG_VERSION
 void __dlist_debug_check(const struct dlist_head *head) {
+#ifndef NDEBUG
 	const struct dlist_head *p = head->prev;
 	const struct dlist_head *n = head->next;
 	uintptr_t poison = head->poison;
<|current_version|>
/**
 * @file
 * @brief Paranoia checks of doubly-linked lists
 *
 * @date 05.12.2013
 * @author Eldar Abusalimov
 */
#include <inttypes.h>
#include <assert.h>

#include <util/dlist.h>

#if DLIST_DEBUG_VERSION
void __dlist_debug_check(const struct dlist_head *head) {
#ifndef NDEBUG
	const struct dlist_head *p = head->prev;
	const struct dlist_head *n = head->next;
	uintptr_t poison = head->poison;

	assertf(((!poison || (void *) ~poison == head) &&
			n->prev == head &&
			p->next == head),
			"\n"
			"head: %p, poison: %p, ~poison: %p,\n"
			"n: %p, n->prev: %p,\n"
			"p: %p, p->next: %p\n",
			head, (void *)poison, (void *) ~poison,
			n, n->prev,
			p, p->next);
}
#endif

<|next_version|>
/**
 * @file
 * @brief Paranoia checks of doubly-linked lists
 *
 * @date 05.12.2013
 * @author Eldar Abusalimov
 */
#include <inttypes.h>
#include <assert.h>

#include <util/dlist.h>

#if DLIST_DEBUG_VERSION
void __dlist_debug_check(const struct dlist_head *head) {
#ifndef NDEBUG
	const struct dlist_head *p = head->prev;
	const struct dlist_head *n = head->next;
	uintptr_t poison = head->poison;

	assertf(((!poison || (void *) ~poison == head) &&
			n->prev == head &&
			p->next == head),
			"\n"
			"head: %p, poison: %p, ~poison: %p,\n"
			"n: %p, n->prev: %p,\n"
			"p: %p, p->next: %p\n",
			head, (void *)poison, (void *) ~poison,
			n, n->prev,
			p, p->next);
#endif
}
#endif


Add subclassing headers for the table and collection view adapter to the umbrella header

--- FTFountain/iOS/FTFountainiOS.h
+++ FTFountain/iOS/FTFountainiOS.h
@@ -8,4 +8,6 @@

 // Adapter
 #import "FTTableViewAdapter.h"
+#import "FTTableViewAdapter+Subclassing.h"
 #import "FTCollectionViewAdapter.h"
+#import "FTCollectionViewAdapter+Subclassing.h"

<|original_code|>
//
//  FTFountainiOS.h
//  FTFountain
//
//  Created by Tobias Kräntzer on 18.07.15.
//  Copyright (c) 2015 Tobias Kräntzer. All rights reserved.
//

// Adapter
#import "FTTableViewAdapter.h"
#import "FTCollectionViewAdapter.h"

<|edits_diff|>
--- FTFountain/iOS/FTFountainiOS.h
+++ FTFountain/iOS/FTFountainiOS.h
@@ -8,4 +8,5 @@

 // Adapter
 #import "FTTableViewAdapter.h"
+#import "FTTableViewAdapter+Subclassing.h"
 #import "FTCollectionViewAdapter.h"
<|current_version|>
//
//  FTFountainiOS.h
//  FTFountain
//
//  Created by Tobias Kräntzer on 18.07.15.
//  Copyright (c) 2015 Tobias Kräntzer. All rights reserved.
//

// Adapter
#import "FTTableViewAdapter.h"
#import "FTTableViewAdapter+Subclassing.h"
#import "FTCollectionViewAdapter.h"

<|next_version|>
//
//  FTFountainiOS.h
//  FTFountain
//
//  Created by Tobias Kräntzer on 18.07.15.
//  Copyright (c) 2015 Tobias Kräntzer. All rights reserved.
//

// Adapter
#import "FTTableViewAdapter.h"
#import "FTTableViewAdapter+Subclassing.h"
#import "FTCollectionViewAdapter.h"
#import "FTCollectionViewAdapter+Subclassing.h"


Support RN 0.40 headers while retaining backwards compatibility.

Use #if to conditionally import React headers.

--- RNSketch/RNSketchManager.h
+++ RNSketch/RNSketchManager.h
@@ -6,7 +6,13 @@
 //  Copyright © 2016 Jeremy Grancher. All rights reserved.
 //

+#if __has_include(<React/RCTViewManager.h>)
+// React Native >= 0.40
+#import <React/RCTViewManager.h>
+#else
+// React Native <= 0.39
 #import "RCTViewManager.h"
+#endif
 #import "RNSketch.h"

 @interface RNSketchManager : RCTViewManager

<|original_code|>
//
//  RNSketchManager.m
//  RNSketch
//
//  Created by Jeremy Grancher on 28/04/2016.
//  Copyright © 2016 Jeremy Grancher. All rights reserved.
//

#import "RCTViewManager.h"
#import "RNSketch.h"

@interface RNSketchManager : RCTViewManager

@property (strong) RNSketch *sketchView;

@end;

<|edits_diff|>
--- RNSketch/RNSketchManager.h
+++ RNSketch/RNSketchManager.h
@@ -6,6 +6,11 @@
 //  Copyright © 2016 Jeremy Grancher. All rights reserved.
 //

+#if __has_include(<React/RCTViewManager.h>)
+// React Native >= 0.40
+#import <React/RCTViewManager.h>
+#else
+// React Native <= 0.39
 #import "RCTViewManager.h"
 #import "RNSketch.h"

<|current_version|>
//
//  RNSketchManager.m
//  RNSketch
//
//  Created by Jeremy Grancher on 28/04/2016.
//  Copyright © 2016 Jeremy Grancher. All rights reserved.
//

#if __has_include(<React/RCTViewManager.h>)
// React Native >= 0.40
#import <React/RCTViewManager.h>
#else
// React Native <= 0.39
#import "RCTViewManager.h"
#import "RNSketch.h"

@interface RNSketchManager : RCTViewManager

@property (strong) RNSketch *sketchView;

@end;

<|next_version|>
//
//  RNSketchManager.m
//  RNSketch
//
//  Created by Jeremy Grancher on 28/04/2016.
//  Copyright © 2016 Jeremy Grancher. All rights reserved.
//

#if __has_include(<React/RCTViewManager.h>)
// React Native >= 0.40
#import <React/RCTViewManager.h>
#else
// React Native <= 0.39
#import "RCTViewManager.h"
#endif
#import "RNSketch.h"

@interface RNSketchManager : RCTViewManager

@property (strong) RNSketch *sketchView;

@end;


Add category headers to global header.

Add category headers to global header.

--- Category/UIKit/UIKitCategory.h
+++ Category/UIKit/UIKitCategory.h
@@ -7,13 +7,19 @@
 //

 #import "UIApplication+Keyboard.h"
+#import "UIApplication+TopmostViewController.h"
+#import "UIBarButtonItem+Block.h"
 #import "UIBezierPath+Drawing.h"
+#import "UIButton+Align.h"
+#import "UICollectionView+Register.h"
 #import "UIColor+CreateColor.h"
 #import "UIImage+CreateImage.h"
 #import "UIImage+ImageProcessing.h"
 #import "UIImageView+CreateImageView.h"
 #import "UIScreen+Size.h"
 #import "UIStoryboard+GetInstance.h"
+#import "UITableView+Register.h"
 #import "UITextField+Color.h"
 #import "UIView+Capture.h"
 #import "UIView+Rounding.h"
+#import "UIViewController+Present.h"

<|original_code|>
//
//  UIKitCategory.h
//  WWCategory
//
//  Created by ww on 2016. 1. 10..
//  Copyright © 2016년 Won Woo Choi. All rights reserved.
//

#import "UIApplication+Keyboard.h"
#import "UIBezierPath+Drawing.h"
#import "UIColor+CreateColor.h"
#import "UIImage+CreateImage.h"
#import "UIImage+ImageProcessing.h"
#import "UIImageView+CreateImageView.h"
#import "UIScreen+Size.h"
#import "UIStoryboard+GetInstance.h"
#import "UITextField+Color.h"
#import "UIView+Capture.h"
#import "UIView+Rounding.h"

<|edits_diff|>
--- Category/UIKit/UIKitCategory.h
+++ Category/UIKit/UIKitCategory.h
@@ -7,13 +7,18 @@
 //

 #import "UIApplication+Keyboard.h"
+#import "UIApplication+TopmostViewController.h"
+#import "UIBarButtonItem+Block.h"
 #import "UIBezierPath+Drawing.h"
+#import "UIButton+Align.h"
+#import "UICollectionView+Register.h"
 #import "UIColor+CreateColor.h"
 #import "UIImage+CreateImage.h"
 #import "UIImage+ImageProcessing.h"
 #import "UIImageView+CreateImageView.h"
 #import "UIScreen+Size.h"
 #import "UIStoryboard+GetInstance.h"
+#import "UITableView+Register.h"
 #import "UITextField+Color.h"
 #import "UIView+Capture.h"
 #import "UIView+Rounding.h"
<|current_version|>
//
//  UIKitCategory.h
//  WWCategory
//
//  Created by ww on 2016. 1. 10..
//  Copyright © 2016년 Won Woo Choi. All rights reserved.
//

#import "UIApplication+Keyboard.h"
#import "UIApplication+TopmostViewController.h"
#import "UIBarButtonItem+Block.h"
#import "UIBezierPath+Drawing.h"
#import "UIButton+Align.h"
#import "UICollectionView+Register.h"
#import "UIColor+CreateColor.h"
#import "UIImage+CreateImage.h"
#import "UIImage+ImageProcessing.h"
#import "UIImageView+CreateImageView.h"
#import "UIScreen+Size.h"
#import "UIStoryboard+GetInstance.h"
#import "UITableView+Register.h"
#import "UITextField+Color.h"
#import "UIView+Capture.h"
#import "UIView+Rounding.h"

<|next_version|>
//
//  UIKitCategory.h
//  WWCategory
//
//  Created by ww on 2016. 1. 10..
//  Copyright © 2016년 Won Woo Choi. All rights reserved.
//

#import "UIApplication+Keyboard.h"
#import "UIApplication+TopmostViewController.h"
#import "UIBarButtonItem+Block.h"
#import "UIBezierPath+Drawing.h"
#import "UIButton+Align.h"
#import "UICollectionView+Register.h"
#import "UIColor+CreateColor.h"
#import "UIImage+CreateImage.h"
#import "UIImage+ImageProcessing.h"
#import "UIImageView+CreateImageView.h"
#import "UIScreen+Size.h"
#import "UIStoryboard+GetInstance.h"
#import "UITableView+Register.h"
#import "UITextField+Color.h"
#import "UIView+Capture.h"
#import "UIView+Rounding.h"
#import "UIViewController+Present.h"


Change headers for react-native 0.40 compatibility

--- ReactLocalization.h
+++ ReactLocalization.h
@@ -23,8 +23,13 @@

 #import <Foundation/Foundation.h>
 #import <UIKit/UIDevice.h>
+#if __has_include("RCTBridgeModule.h")
 #import "RCTBridgeModule.h"
 #import "RCTLog.h"
+#else
+#import <React/RCTBridgeModule.h>
+#import <React/RCTLog.h>
+#endif
 @interface ReactLocalization : NSObject<RCTBridgeModule>

 @end

<|original_code|>
//
// The MIT License (MIT)
//
// Copyright (c) 2015 Stefano Falda (stefano.falda@gmail.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#import <Foundation/Foundation.h>
#import <UIKit/UIDevice.h>
#import "RCTBridgeModule.h"
#import "RCTLog.h"
@interface ReactLocalization : NSObject<RCTBridgeModule>

@end

<|edits_diff|>
--- ReactLocalization.h
+++ ReactLocalization.h
@@ -23,6 +23,7 @@

 #import <Foundation/Foundation.h>
 #import <UIKit/UIDevice.h>
+#if __has_include("RCTBridgeModule.h")
 #import "RCTBridgeModule.h"
 #import "RCTLog.h"
 @interface ReactLocalization : NSObject<RCTBridgeModule>
<|current_version|>
//
// The MIT License (MIT)
//
// Copyright (c) 2015 Stefano Falda (stefano.falda@gmail.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#import <Foundation/Foundation.h>
#import <UIKit/UIDevice.h>
#if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#import "RCTLog.h"
@interface ReactLocalization : NSObject<RCTBridgeModule>

@end

<|next_version|>
//
// The MIT License (MIT)
//
// Copyright (c) 2015 Stefano Falda (stefano.falda@gmail.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#import <Foundation/Foundation.h>
#import <UIKit/UIDevice.h>
#if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#import "RCTLog.h"
#else
#import <React/RCTBridgeModule.h>
#import <React/RCTLog.h>
#endif
@interface ReactLocalization : NSObject<RCTBridgeModule>

@end


Use NS_ASSUME_NONNULL_BEGIN/END macros in Obj-C header

The mutex object and block shouldn't be null. We could change the API to accept null but I don't think that's natural to do (and the Swift API forbids it anyway right now).

--- Synchronized/ObjCSynchronized.h
+++ Synchronized/ObjCSynchronized.h
@@ -20,4 +20,10 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.

+@import Foundation;
+
+NS_ASSUME_NONNULL_BEGIN
+
 void objc_synchronized(id object, __attribute__((noescape)) void (^closure)());
+
+NS_ASSUME_NONNULL_END

<|original_code|>
// The MIT License (MIT)
//
// Copyright (c) 2014-present James Ide
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

void objc_synchronized(id object, __attribute__((noescape)) void (^closure)());

<|edits_diff|>
--- Synchronized/ObjCSynchronized.h
+++ Synchronized/ObjCSynchronized.h
@@ -20,4 +20,8 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.

+@import Foundation;
+
+NS_ASSUME_NONNULL_BEGIN
+
 void objc_synchronized(id object, __attribute__((noescape)) void (^closure)());
<|current_version|>
// The MIT License (MIT)
//
// Copyright (c) 2014-present James Ide
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

@import Foundation;

NS_ASSUME_NONNULL_BEGIN

void objc_synchronized(id object, __attribute__((noescape)) void (^closure)());

<|next_version|>
// The MIT License (MIT)
//
// Copyright (c) 2014-present James Ide
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

@import Foundation;

NS_ASSUME_NONNULL_BEGIN

void objc_synchronized(id object, __attribute__((noescape)) void (^closure)());

NS_ASSUME_NONNULL_END


Use my_sleep instead of nanosleep for portability

--- ndb/src/common/portlib/NdbSleep.c
+++ ndb/src/common/portlib/NdbSleep.c
@@ -16,16 +16,21 @@

 #include <ndb_global.h>
+#include <my_sys.h>
 #include <NdbSleep.h>

 int
 NdbSleep_MilliSleep(int milliseconds){
+  my_sleep(milliseconds*1000);
+  return 0;
+#if 0
   int result = 0;
   struct timespec sleeptime;
   sleeptime.tv_sec = milliseconds / 1000;
   sleeptime.tv_nsec = (milliseconds - (sleeptime.tv_sec * 1000)) * 1000000;
   result = nanosleep(&sleeptime, NULL);
   return result;
+#endif
 }

 int

<|original_code|>
/* Copyright (C) 2003 MySQL AB

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

#include <ndb_global.h>
#include <NdbSleep.h>

int
NdbSleep_MilliSleep(int milliseconds){
  int result = 0;
  struct timespec sleeptime;
  sleeptime.tv_sec = milliseconds / 1000;
  sleeptime.tv_nsec = (milliseconds - (sleeptime.tv_sec * 1000)) * 1000000;
  result = nanosleep(&sleeptime, NULL);
  return result;
}

int
NdbSleep_SecSleep(int seconds){
  int result = 0;
  result = sleep(seconds);
  return result;
}

<|edits_diff|>
--- ndb/src/common/portlib/NdbSleep.c
+++ ndb/src/common/portlib/NdbSleep.c
@@ -16,10 +16,14 @@

 #include <ndb_global.h>
+#include <my_sys.h>
 #include <NdbSleep.h>

 int
 NdbSleep_MilliSleep(int milliseconds){
+  my_sleep(milliseconds*1000);
+  return 0;
+#if 0
   int result = 0;
   struct timespec sleeptime;
   sleeptime.tv_sec = milliseconds / 1000;
<|current_version|>
/* Copyright (C) 2003 MySQL AB

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

#include <ndb_global.h>
#include <my_sys.h>
#include <NdbSleep.h>

int
NdbSleep_MilliSleep(int milliseconds){
  my_sleep(milliseconds*1000);
  return 0;
#if 0
  int result = 0;
  struct timespec sleeptime;
  sleeptime.tv_sec = milliseconds / 1000;
  sleeptime.tv_nsec = (milliseconds - (sleeptime.tv_sec * 1000)) * 1000000;
  result = nanosleep(&sleeptime, NULL);
  return result;
}

int
NdbSleep_SecSleep(int seconds){
  int result = 0;
  result = sleep(seconds);
  return result;
}

<|next_version|>
/* Copyright (C) 2003 MySQL AB

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

#include <ndb_global.h>
#include <my_sys.h>
#include <NdbSleep.h>

int
NdbSleep_MilliSleep(int milliseconds){
  my_sleep(milliseconds*1000);
  return 0;
#if 0
  int result = 0;
  struct timespec sleeptime;
  sleeptime.tv_sec = milliseconds / 1000;
  sleeptime.tv_nsec = (milliseconds - (sleeptime.tv_sec * 1000)) * 1000000;
  result = nanosleep(&sleeptime, NULL);
  return result;
#endif
}

int
NdbSleep_SecSleep(int seconds){
  int result = 0;
  result = sleep(seconds);
  return result;
}


Extend interfaces with new parsing functions

--- Archs/Architecture.h
+++ Archs/Architecture.h
@@ -1,6 +1,8 @@
 #pragma once

 class IElfRelocator;
+class CAssemblerCommand;
+class Tokenizer;

 enum class Endianness { Big, Little };

@@ -9,6 +11,8 @@
 public:
 	virtual void AssembleOpcode(const std::wstring& name, const std::wstring& args) = 0;
 	virtual bool AssembleDirective(const std::wstring& name, const std::wstring& args) = 0;
+	virtual CAssemblerCommand* parseDirective(Tokenizer& tokenizer) { return nullptr; };
+	virtual CAssemblerCommand* parseOpcode(Tokenizer& tokenizer) { return nullptr; };
 	virtual void NextSection() = 0;
 	virtual void Pass2() = 0;
 	virtual void Revalidate() = 0;

<|original_code|>
#pragma once

class IElfRelocator;

enum class Endianness { Big, Little };

class CArchitecture
{
public:
	virtual void AssembleOpcode(const std::wstring& name, const std::wstring& args) = 0;
	virtual bool AssembleDirective(const std::wstring& name, const std::wstring& args) = 0;
	virtual void NextSection() = 0;
	virtual void Pass2() = 0;
	virtual void Revalidate() = 0;
	virtual int GetWordSize() = 0;
	virtual IElfRelocator* getElfRelocator() = 0;
	virtual Endianness getEndianness() = 0;
};

class CInvalidArchitecture: public CArchitecture
{
public:
	virtual void AssembleOpcode(const std::wstring& name, const std::wstring& args);
	virtual bool AssembleDirective(const std::wstring& name, const std::wstring& args);
	virtual void NextSection();
	virtual void Pass2();
	virtual void Revalidate();
	virtual int GetWordSize();
	virtual IElfRelocator* getElfRelocator();
	virtual Endianness getEndianness() { return Endianness::Little; };
};

extern CInvalidArchitecture InvalidArchitecture;

<|edits_diff|>
--- Archs/Architecture.h
+++ Archs/Architecture.h
@@ -1,6 +1,8 @@
 #pragma once

 class IElfRelocator;
+class CAssemblerCommand;
+class Tokenizer;

 enum class Endianness { Big, Little };

<|current_version|>
#pragma once

class IElfRelocator;
class CAssemblerCommand;
class Tokenizer;

enum class Endianness { Big, Little };

class CArchitecture
{
public:
	virtual void AssembleOpcode(const std::wstring& name, const std::wstring& args) = 0;
	virtual bool AssembleDirective(const std::wstring& name, const std::wstring& args) = 0;
	virtual void NextSection() = 0;
	virtual void Pass2() = 0;
	virtual void Revalidate() = 0;
	virtual int GetWordSize() = 0;
	virtual IElfRelocator* getElfRelocator() = 0;
	virtual Endianness getEndianness() = 0;
};

class CInvalidArchitecture: public CArchitecture
{
public:
	virtual void AssembleOpcode(const std::wstring& name, const std::wstring& args);
	virtual bool AssembleDirective(const std::wstring& name, const std::wstring& args);
	virtual void NextSection();
	virtual void Pass2();
	virtual void Revalidate();
	virtual int GetWordSize();
	virtual IElfRelocator* getElfRelocator();
	virtual Endianness getEndianness() { return Endianness::Little; };
};

extern CInvalidArchitecture InvalidArchitecture;

<|next_version|>
#pragma once

class IElfRelocator;
class CAssemblerCommand;
class Tokenizer;

enum class Endianness { Big, Little };

class CArchitecture
{
public:
	virtual void AssembleOpcode(const std::wstring& name, const std::wstring& args) = 0;
	virtual bool AssembleDirective(const std::wstring& name, const std::wstring& args) = 0;
	virtual CAssemblerCommand* parseDirective(Tokenizer& tokenizer) { return nullptr; };
	virtual CAssemblerCommand* parseOpcode(Tokenizer& tokenizer) { return nullptr; };
	virtual void NextSection() = 0;
	virtual void Pass2() = 0;
	virtual void Revalidate() = 0;
	virtual int GetWordSize() = 0;
	virtual IElfRelocator* getElfRelocator() = 0;
	virtual Endianness getEndianness() = 0;
};

class CInvalidArchitecture: public CArchitecture
{
public:
	virtual void AssembleOpcode(const std::wstring& name, const std::wstring& args);
	virtual bool AssembleDirective(const std::wstring& name, const std::wstring& args);
	virtual void NextSection();
	virtual void Pass2();
	virtual void Revalidate();
	virtual int GetWordSize();
	virtual IElfRelocator* getElfRelocator();
	virtual Endianness getEndianness() { return Endianness::Little; };
};

extern CInvalidArchitecture InvalidArchitecture;


Allow tests to override error tolerance

tests: Allow tests to override error tolerance

Signed-off-by: Ola Jeppsson <793f970c52ded1276b9264c742f19d1888cbaf73@adapteva.com>

--- tests/simple.h
+++ tests/simple.h
@@ -11,8 +11,12 @@
 #include <common.h>

 /* Max allowed diff against expected value */
+#ifndef EPSILON_MAX
 #define EPSILON_MAX 0.001f
+#endif
+#ifndef EPSILON_RELMAX
 #define EPSILON_RELMAX 0.00001f
+#endif

 struct gold {
     float ai;

<|original_code|>
#pragma once

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stdbool.h>

#include <check.h>
#include <pal.h>
#include "../../src/base/pal_base_private.h"
#include <common.h>

/* Max allowed diff against expected value */
#define EPSILON_MAX 0.001f
#define EPSILON_RELMAX 0.00001f

struct gold {
    float ai;
    float bi;
    float res;
    float gold;
};

extern float *ai, *bi, *res, *ref;

/* Functions that can be overridden by individual tests */

/* Compare two values */
bool compare(float x, float y);

/* Allow individual tests to add more test cases, e.g. against a reference
 * function */
void add_more_tests(TCase *tcase);

/* Needs to be implemented by tests that define REF_FUNCTION */
void generate_ref(float *out, size_t n);

<|edits_diff|>
--- tests/simple.h
+++ tests/simple.h
@@ -11,7 +11,10 @@
 #include <common.h>

 /* Max allowed diff against expected value */
+#ifndef EPSILON_MAX
 #define EPSILON_MAX 0.001f
+#endif
+#ifndef EPSILON_RELMAX
 #define EPSILON_RELMAX 0.00001f

 struct gold {
<|current_version|>
#pragma once

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stdbool.h>

#include <check.h>
#include <pal.h>
#include "../../src/base/pal_base_private.h"
#include <common.h>

/* Max allowed diff against expected value */
#ifndef EPSILON_MAX
#define EPSILON_MAX 0.001f
#endif
#ifndef EPSILON_RELMAX
#define EPSILON_RELMAX 0.00001f

struct gold {
    float ai;
    float bi;
    float res;
    float gold;
};

extern float *ai, *bi, *res, *ref;

/* Functions that can be overridden by individual tests */

/* Compare two values */
bool compare(float x, float y);

/* Allow individual tests to add more test cases, e.g. against a reference
 * function */
void add_more_tests(TCase *tcase);

/* Needs to be implemented by tests that define REF_FUNCTION */
void generate_ref(float *out, size_t n);

<|next_version|>
#pragma once

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stdbool.h>

#include <check.h>
#include <pal.h>
#include "../../src/base/pal_base_private.h"
#include <common.h>

/* Max allowed diff against expected value */
#ifndef EPSILON_MAX
#define EPSILON_MAX 0.001f
#endif
#ifndef EPSILON_RELMAX
#define EPSILON_RELMAX 0.00001f
#endif

struct gold {
    float ai;
    float bi;
    float res;
    float gold;
};

extern float *ai, *bi, *res, *ref;

/* Functions that can be overridden by individual tests */

/* Compare two values */
bool compare(float x, float y);

/* Allow individual tests to add more test cases, e.g. against a reference
 * function */
void add_more_tests(TCase *tcase);

/* Needs to be implemented by tests that define REF_FUNCTION */
void generate_ref(float *out, size_t n);


Add types "ushort" and "rlim_t" for AIX.

--- src/condor_includes/_condor_fix_types.h
+++ src/condor_includes/_condor_fix_types.h
@@ -19,8 +19,16 @@

 typedef unsigned int u_int;

+#if defined(AIX32)
+typedef unsigned short ushort;
+#endif
+
 #if defined(ULTRIX42) ||  defined(ULTRIX43)
 typedef char * caddr_t;
 #endif

+#if defined(AIX32)
+typedef unsigned long rlim_t;
 #endif
+
+#endif

<|original_code|>
#ifndef FIX_TYPES_H
#define FIX_TYPES_H

#include <sys/types.h>

/*
The system include file defines this in terms of bzero(), but ANSI says
we should use memset().
*/
#if defined(OSF1)
#undef FD_ZERO
#define FD_ZERO(p)     memset((char *)(p), 0, sizeof(*(p)))
#endif

/*
Various non-POSIX conforming files which depend on sys/types.h will
need these extra definitions...
*/

typedef unsigned int u_int;

#if defined(ULTRIX42) ||  defined(ULTRIX43)
typedef char * caddr_t;
#endif

#endif

<|edits_diff|>
--- src/condor_includes/_condor_fix_types.h
+++ src/condor_includes/_condor_fix_types.h
@@ -19,8 +19,14 @@

 typedef unsigned int u_int;

+#if defined(AIX32)
+typedef unsigned short ushort;
+#endif
+
 #if defined(ULTRIX42) ||  defined(ULTRIX43)
 typedef char * caddr_t;
 #endif

+#if defined(AIX32)
+typedef unsigned long rlim_t;
 #endif
<|current_version|>
#ifndef FIX_TYPES_H
#define FIX_TYPES_H

#include <sys/types.h>

/*
The system include file defines this in terms of bzero(), but ANSI says
we should use memset().
*/
#if defined(OSF1)
#undef FD_ZERO
#define FD_ZERO(p)     memset((char *)(p), 0, sizeof(*(p)))
#endif

/*
Various non-POSIX conforming files which depend on sys/types.h will
need these extra definitions...
*/

typedef unsigned int u_int;

#if defined(AIX32)
typedef unsigned short ushort;
#endif

#if defined(ULTRIX42) ||  defined(ULTRIX43)
typedef char * caddr_t;
#endif

#if defined(AIX32)
typedef unsigned long rlim_t;
#endif

<|next_version|>
#ifndef FIX_TYPES_H
#define FIX_TYPES_H

#include <sys/types.h>

/*
The system include file defines this in terms of bzero(), but ANSI says
we should use memset().
*/
#if defined(OSF1)
#undef FD_ZERO
#define FD_ZERO(p)     memset((char *)(p), 0, sizeof(*(p)))
#endif

/*
Various non-POSIX conforming files which depend on sys/types.h will
need these extra definitions...
*/

typedef unsigned int u_int;

#if defined(AIX32)
typedef unsigned short ushort;
#endif

#if defined(ULTRIX42) ||  defined(ULTRIX43)
typedef char * caddr_t;
#endif

#if defined(AIX32)
typedef unsigned long rlim_t;
#endif

#endif


Allow building with the 10.5 SDK.

Allow building with the 10.5 SDK.

--- Demo/Shared/MASPreferencesWindowController.h
+++ Demo/Shared/MASPreferencesWindowController.h
@@ -5,7 +5,11 @@

 extern NSString *const kMASPreferencesWindowControllerDidChangeViewNotification;

+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
 @interface MASPreferencesWindowController : NSWindowController <NSToolbarDelegate, NSWindowDelegate>
+#else
+@interface MASPreferencesWindowController : NSWindowController
+#endif
 {
 @private
     NSArray *_viewControllers;

<|original_code|>
//
//  Created by Vadim Shpakovski on 4/22/11.
//  Copyright 2011 Shpakovski. All rights reserved.
//

extern NSString *const kMASPreferencesWindowControllerDidChangeViewNotification;

@interface MASPreferencesWindowController : NSWindowController <NSToolbarDelegate, NSWindowDelegate>
{
@private
    NSArray *_viewControllers;
    NSString *_title;
    id _lastSelectedController;
}

@property (nonatomic, readonly) NSArray *viewControllers;
@property (nonatomic, readonly) NSUInteger indexOfSelectedController;
@property (nonatomic, readonly) NSViewController *selectedViewController;
@property (nonatomic, readonly) NSString *title;

- (id)initWithViewControllers:(NSArray *)viewControllers;
- (id)initWithViewControllers:(NSArray *)viewControllers title:(NSString *)title;

- (void)selectControllerAtIndex:(NSUInteger)controllerIndex withAnimation:(BOOL)animate;

- (IBAction)goNextTab:(id)sender;
- (IBAction)goPreviousTab:(id)sender;

- (void)resetFirstResponderInView:(NSView *)view;

@end

<|edits_diff|>
--- Demo/Shared/MASPreferencesWindowController.h
+++ Demo/Shared/MASPreferencesWindowController.h
@@ -5,6 +5,7 @@

 extern NSString *const kMASPreferencesWindowControllerDidChangeViewNotification;

+#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
 @interface MASPreferencesWindowController : NSWindowController <NSToolbarDelegate, NSWindowDelegate>
 {
 @private
<|current_version|>
//
//  Created by Vadim Shpakovski on 4/22/11.
//  Copyright 2011 Shpakovski. All rights reserved.
//

extern NSString *const kMASPreferencesWindowControllerDidChangeViewNotification;

#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
@interface MASPreferencesWindowController : NSWindowController <NSToolbarDelegate, NSWindowDelegate>
{
@private
    NSArray *_viewControllers;
    NSString *_title;
    id _lastSelectedController;
}

@property (nonatomic, readonly) NSArray *viewControllers;
@property (nonatomic, readonly) NSUInteger indexOfSelectedController;
@property (nonatomic, readonly) NSViewController *selectedViewController;
@property (nonatomic, readonly) NSString *title;

- (id)initWithViewControllers:(NSArray *)viewControllers;
- (id)initWithViewControllers:(NSArray *)viewControllers title:(NSString *)title;

- (void)selectControllerAtIndex:(NSUInteger)controllerIndex withAnimation:(BOOL)animate;

- (IBAction)goNextTab:(id)sender;
- (IBAction)goPreviousTab:(id)sender;

- (void)resetFirstResponderInView:(NSView *)view;

@end

<|next_version|>
//
//  Created by Vadim Shpakovski on 4/22/11.
//  Copyright 2011 Shpakovski. All rights reserved.
//

extern NSString *const kMASPreferencesWindowControllerDidChangeViewNotification;

#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
@interface MASPreferencesWindowController : NSWindowController <NSToolbarDelegate, NSWindowDelegate>
#else
@interface MASPreferencesWindowController : NSWindowController
#endif
{
@private
    NSArray *_viewControllers;
    NSString *_title;
    id _lastSelectedController;
}

@property (nonatomic, readonly) NSArray *viewControllers;
@property (nonatomic, readonly) NSUInteger indexOfSelectedController;
@property (nonatomic, readonly) NSViewController *selectedViewController;
@property (nonatomic, readonly) NSString *title;

- (id)initWithViewControllers:(NSArray *)viewControllers;
- (id)initWithViewControllers:(NSArray *)viewControllers title:(NSString *)title;

- (void)selectControllerAtIndex:(NSUInteger)controllerIndex withAnimation:(BOOL)animate;

- (IBAction)goNextTab:(id)sender;
- (IBAction)goPreviousTab:(id)sender;

- (void)resetFirstResponderInView:(NSView *)view;

@end


Disable MoPub logging for release builds.

--- MoPubSDK/MPConstants.h
+++ MoPubSDK/MPConstants.h
@@ -8,7 +8,11 @@

 #import <UIKit/UIKit.h>

+#if DEBUG
 #define MP_DEBUG_MODE               1
+#else
+#define MP_DEBUG_MODE               0
+#endif

 #define HOSTNAME                    @"ads.mopub.com"
 #define HOSTNAME_FOR_TESTING        @"testing.ads.mopub.com"

<|original_code|>
//
//  MPConstants.h
//  MoPub
//
//  Created by Nafis Jamal on 2/9/11.
//  Copyright 2011 MoPub, Inc. All rights reserved.
//

#import <UIKit/UIKit.h>

#define MP_DEBUG_MODE               1

#define HOSTNAME                    @"ads.mopub.com"
#define HOSTNAME_FOR_TESTING        @"testing.ads.mopub.com"
#define DEFAULT_PUB_ID              @"agltb3B1Yi1pbmNyDAsSBFNpdGUYkaoMDA"
#define MP_SERVER_VERSION           @"8"
#define MP_SDK_VERSION              @"1.16.0.1"

// Sizing constants.
#define MOPUB_BANNER_SIZE           CGSizeMake(320, 50)
#define MOPUB_MEDIUM_RECT_SIZE      CGSizeMake(300, 250)
#define MOPUB_LEADERBOARD_SIZE      CGSizeMake(728, 90)
#define MOPUB_WIDE_SKYSCRAPER_SIZE  CGSizeMake(160, 600)

// Miscellaneous constants.
#define MINIMUM_REFRESH_INTERVAL            5.0
#define DEFAULT_BANNER_REFRESH_INTERVAL     60
#define BANNER_TIMEOUT_INTERVAL             10
#define INTERSTITIAL_TIMEOUT_INTERVAL       30

// Feature Flags
#define SESSION_TRACKING_ENABLED            1

<|edits_diff|>
--- MoPubSDK/MPConstants.h
+++ MoPubSDK/MPConstants.h
@@ -8,6 +8,7 @@

 #import <UIKit/UIKit.h>

+#if DEBUG
 #define MP_DEBUG_MODE               1

 #define HOSTNAME                    @"ads.mopub.com"
<|current_version|>
//
//  MPConstants.h
//  MoPub
//
//  Created by Nafis Jamal on 2/9/11.
//  Copyright 2011 MoPub, Inc. All rights reserved.
//

#import <UIKit/UIKit.h>

#if DEBUG
#define MP_DEBUG_MODE               1

#define HOSTNAME                    @"ads.mopub.com"
#define HOSTNAME_FOR_TESTING        @"testing.ads.mopub.com"
#define DEFAULT_PUB_ID              @"agltb3B1Yi1pbmNyDAsSBFNpdGUYkaoMDA"
#define MP_SERVER_VERSION           @"8"
#define MP_SDK_VERSION              @"1.16.0.1"

// Sizing constants.
#define MOPUB_BANNER_SIZE           CGSizeMake(320, 50)
#define MOPUB_MEDIUM_RECT_SIZE      CGSizeMake(300, 250)
#define MOPUB_LEADERBOARD_SIZE      CGSizeMake(728, 90)
#define MOPUB_WIDE_SKYSCRAPER_SIZE  CGSizeMake(160, 600)

// Miscellaneous constants.
#define MINIMUM_REFRESH_INTERVAL            5.0
#define DEFAULT_BANNER_REFRESH_INTERVAL     60
#define BANNER_TIMEOUT_INTERVAL             10
#define INTERSTITIAL_TIMEOUT_INTERVAL       30

// Feature Flags
#define SESSION_TRACKING_ENABLED            1

<|next_version|>
//
//  MPConstants.h
//  MoPub
//
//  Created by Nafis Jamal on 2/9/11.
//  Copyright 2011 MoPub, Inc. All rights reserved.
//

#import <UIKit/UIKit.h>

#if DEBUG
#define MP_DEBUG_MODE               1
#else
#define MP_DEBUG_MODE               0
#endif

#define HOSTNAME                    @"ads.mopub.com"
#define HOSTNAME_FOR_TESTING        @"testing.ads.mopub.com"
#define DEFAULT_PUB_ID              @"agltb3B1Yi1pbmNyDAsSBFNpdGUYkaoMDA"
#define MP_SERVER_VERSION           @"8"
#define MP_SDK_VERSION              @"1.16.0.1"

// Sizing constants.
#define MOPUB_BANNER_SIZE           CGSizeMake(320, 50)
#define MOPUB_MEDIUM_RECT_SIZE      CGSizeMake(300, 250)
#define MOPUB_LEADERBOARD_SIZE      CGSizeMake(728, 90)
#define MOPUB_WIDE_SKYSCRAPER_SIZE  CGSizeMake(160, 600)

// Miscellaneous constants.
#define MINIMUM_REFRESH_INTERVAL            5.0
#define DEFAULT_BANNER_REFRESH_INTERVAL     60
#define BANNER_TIMEOUT_INTERVAL             10
#define INTERSTITIAL_TIMEOUT_INTERVAL       30

// Feature Flags
#define SESSION_TRACKING_ENABLED            1


Add remote array classes to headers.

Add remote array classes to headers.

--- SVNetworking/SVNetworking/SVNetworking.h
+++ SVNetworking/SVNetworking/SVNetworking.h
@@ -13,10 +13,12 @@
 #import "SVFunctional.h"
 #import "SVImageView.h"
 #import "SVJSONRequest.h"
+#import "SVRemoteArray.h"
 #import "SVRemoteImage.h"
 #import "SVRemoteImageProtocol.h"
 #import "SVRemoteDataRequestResource.h"
 #import "SVRemoteDataResource.h"
+#import "SVRemoteJSONArray.h"
 #import "SVRemoteJSONRequestResource.h"
 #import "SVRemoteJSONResource.h"
 #import "SVRemoteProxyResource.h"

<|original_code|>
//
//  SVNetworking.h
//  SVNetworking
//
//  Created by Nate Stedman on 3/14/14.
//  Copyright (c) 2014 Svpply. All rights reserved.
//

#import "NSObject+SVBindings.h"
#import "NSObject+SVMultibindings.h"
#import "SVDataRequest.h"
#import "SVDiskCache.h"
#import "SVFunctional.h"
#import "SVImageView.h"
#import "SVJSONRequest.h"
#import "SVRemoteImage.h"
#import "SVRemoteImageProtocol.h"
#import "SVRemoteDataRequestResource.h"
#import "SVRemoteDataResource.h"
#import "SVRemoteJSONRequestResource.h"
#import "SVRemoteJSONResource.h"
#import "SVRemoteProxyResource.h"
#import "SVRemoteResource.h"
#import "SVRemoteRetainedScaledImage.h"
#import "SVRemoteScaledImage.h"
#import "SVRemoteScaledImageProtocol.h"
#import "SVRequest.h"

<|edits_diff|>
--- SVNetworking/SVNetworking/SVNetworking.h
+++ SVNetworking/SVNetworking/SVNetworking.h
@@ -13,6 +13,7 @@
 #import "SVFunctional.h"
 #import "SVImageView.h"
 #import "SVJSONRequest.h"
+#import "SVRemoteArray.h"
 #import "SVRemoteImage.h"
 #import "SVRemoteImageProtocol.h"
 #import "SVRemoteDataRequestResource.h"
<|current_version|>
//
//  SVNetworking.h
//  SVNetworking
//
//  Created by Nate Stedman on 3/14/14.
//  Copyright (c) 2014 Svpply. All rights reserved.
//

#import "NSObject+SVBindings.h"
#import "NSObject+SVMultibindings.h"
#import "SVDataRequest.h"
#import "SVDiskCache.h"
#import "SVFunctional.h"
#import "SVImageView.h"
#import "SVJSONRequest.h"
#import "SVRemoteArray.h"
#import "SVRemoteImage.h"
#import "SVRemoteImageProtocol.h"
#import "SVRemoteDataRequestResource.h"
#import "SVRemoteDataResource.h"
#import "SVRemoteJSONRequestResource.h"
#import "SVRemoteJSONResource.h"
#import "SVRemoteProxyResource.h"
#import "SVRemoteResource.h"
#import "SVRemoteRetainedScaledImage.h"
#import "SVRemoteScaledImage.h"
#import "SVRemoteScaledImageProtocol.h"
#import "SVRequest.h"

<|next_version|>
//
//  SVNetworking.h
//  SVNetworking
//
//  Created by Nate Stedman on 3/14/14.
//  Copyright (c) 2014 Svpply. All rights reserved.
//

#import "NSObject+SVBindings.h"
#import "NSObject+SVMultibindings.h"
#import "SVDataRequest.h"
#import "SVDiskCache.h"
#import "SVFunctional.h"
#import "SVImageView.h"
#import "SVJSONRequest.h"
#import "SVRemoteArray.h"
#import "SVRemoteImage.h"
#import "SVRemoteImageProtocol.h"
#import "SVRemoteDataRequestResource.h"
#import "SVRemoteDataResource.h"
#import "SVRemoteJSONArray.h"
#import "SVRemoteJSONRequestResource.h"
#import "SVRemoteJSONResource.h"
#import "SVRemoteProxyResource.h"
#import "SVRemoteResource.h"
#import "SVRemoteRetainedScaledImage.h"
#import "SVRemoteScaledImage.h"
#import "SVRemoteScaledImageProtocol.h"
#import "SVRequest.h"


Apply HAVE_CONFIG_H condition in src/tests/uiomux_test.h

config.h should be included only if HAVE_CONFIG_H defined
when autoconf used.

--- src/tests/uiomux_tests.h
+++ src/tests/uiomux_tests.h
@@ -17,7 +17,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
  */

+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif

 #include <stdio.h>
 #include <stdlib.h>

<|original_code|>
/*
 * UIOMux: a conflict manager for system resources, including UIO devices.
 * Copyright (C) 2009 Renesas Technology Corp.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
 */

#include "config.h"

#include <stdio.h>
#include <stdlib.h>

#define INFO(str) \
  { printf ("----  %s ...\n", (str)); }

#define WARN(str) \
  { printf ("%s:%d: warning: %s\n", __FILE__, __LINE__, (str)); }

#define FAIL(str) \
  { printf ("%s:%d: %s\n", __FILE__, __LINE__, (str)); exit(1); }

<|edits_diff|>
--- src/tests/uiomux_tests.h
+++ src/tests/uiomux_tests.h
@@ -17,6 +17,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
  */

+#ifdef HAVE_CONFIG_H
 #include "config.h"

 #include <stdio.h>
<|current_version|>
/*
 * UIOMux: a conflict manager for system resources, including UIO devices.
 * Copyright (C) 2009 Renesas Technology Corp.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
 */

#ifdef HAVE_CONFIG_H
#include "config.h"

#include <stdio.h>
#include <stdlib.h>

#define INFO(str) \
  { printf ("----  %s ...\n", (str)); }

#define WARN(str) \
  { printf ("%s:%d: warning: %s\n", __FILE__, __LINE__, (str)); }

#define FAIL(str) \
  { printf ("%s:%d: %s\n", __FILE__, __LINE__, (str)); exit(1); }

<|next_version|>
/*
 * UIOMux: a conflict manager for system resources, including UIO devices.
 * Copyright (C) 2009 Renesas Technology Corp.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <stdlib.h>

#define INFO(str) \
  { printf ("----  %s ...\n", (str)); }

#define WARN(str) \
  { printf ("%s:%d: warning: %s\n", __FILE__, __LINE__, (str)); }

#define FAIL(str) \
  { printf ("%s:%d: %s\n", __FILE__, __LINE__, (str)); exit(1); }


Fix cut off BPM on aplite and basalt

Fix cut off BPM on aplite and basalt

Previously, BPMs that rendered wide, specifically 100.0 and simlar, would get
cut off on these platforms. This change decreases border size on square watches
to prevent this from happening.

--- src/config.h
+++ src/config.h
@@ -4,7 +4,11 @@

 #define BG_COLOR GColorWhite

+#ifdef PBL_ROUND
 #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12)
+#else
+#define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 2)
+#endif

 #define BPM_FONT FONT_KEY_BITHAM_42_BOLD
 #define BPM_FONT_HEIGHT 42

<|original_code|>
#pragma once

#include <pebble.h>

#define BG_COLOR GColorWhite

#define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12)

#define BPM_FONT FONT_KEY_BITHAM_42_BOLD
#define BPM_FONT_HEIGHT 42
#define BPM_DEFAULT "---"

#define BPM_HINT_FONT FONT_KEY_GOTHIC_24_BOLD
#define BPM_HINT_FONT_HEIGHT 24
#define BPM_HINT_TEXT "BPM:"

#define BPM_TEXT_BUFFER_SIZE 10

#define TAP_TIMEOUT_SECONDS 2

<|edits_diff|>
--- src/config.h
+++ src/config.h
@@ -4,6 +4,7 @@

 #define BG_COLOR GColorWhite

+#ifdef PBL_ROUND
 #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12)

 #define BPM_FONT FONT_KEY_BITHAM_42_BOLD
<|current_version|>
#pragma once

#include <pebble.h>

#define BG_COLOR GColorWhite

#ifdef PBL_ROUND
#define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12)

#define BPM_FONT FONT_KEY_BITHAM_42_BOLD
#define BPM_FONT_HEIGHT 42
#define BPM_DEFAULT "---"

#define BPM_HINT_FONT FONT_KEY_GOTHIC_24_BOLD
#define BPM_HINT_FONT_HEIGHT 24
#define BPM_HINT_TEXT "BPM:"

#define BPM_TEXT_BUFFER_SIZE 10

#define TAP_TIMEOUT_SECONDS 2

<|next_version|>
#pragma once

#include <pebble.h>

#define BG_COLOR GColorWhite

#ifdef PBL_ROUND
#define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12)
#else
#define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 2)
#endif

#define BPM_FONT FONT_KEY_BITHAM_42_BOLD
#define BPM_FONT_HEIGHT 42
#define BPM_DEFAULT "---"

#define BPM_HINT_FONT FONT_KEY_GOTHIC_24_BOLD
#define BPM_HINT_FONT_HEIGHT 24
#define BPM_HINT_TEXT "BPM:"

#define BPM_TEXT_BUFFER_SIZE 10

#define TAP_TIMEOUT_SECONDS 2


Allow PS test03 with PS_ALLOW_ENTIRE_STORAGE_FILL flag

--- components/TARGET_PSA/TESTS/compliance_its/test_s003/main.c
+++ components/TARGET_PSA/TESTS/compliance_its/test_s003/main.c
@@ -5,7 +5,9 @@
 #ifdef ITS_TEST
 void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api);
 #elif PS_TEST
+#ifndef PS_ALLOW_ENTIRE_STORAGE_FILL
 #error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout.
+#endif
 void test_entry_p003(val_api_t *val_api, psa_api_t *psa_api);
 #endif

<|original_code|>
#include "val_interfaces.h"
#include "pal_mbed_os_crypto.h"
#include "lifecycle.h"

#ifdef ITS_TEST
void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
#error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout.
void test_entry_p003(val_api_t *val_api, psa_api_t *psa_api);
#endif

int main(void)
{
#ifdef ITS_TEST
    test_start(test_entry_s003);
#elif PS_TEST
    test_start(test_entry_p003);
#endif

}

<|edits_diff|>
--- components/TARGET_PSA/TESTS/compliance_its/test_s003/main.c
+++ components/TARGET_PSA/TESTS/compliance_its/test_s003/main.c
@@ -5,6 +5,7 @@
 #ifdef ITS_TEST
 void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api);
 #elif PS_TEST
+#ifndef PS_ALLOW_ENTIRE_STORAGE_FILL
 #error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout.
 void test_entry_p003(val_api_t *val_api, psa_api_t *psa_api);
 #endif
<|current_version|>
#include "val_interfaces.h"
#include "pal_mbed_os_crypto.h"
#include "lifecycle.h"

#ifdef ITS_TEST
void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
#ifndef PS_ALLOW_ENTIRE_STORAGE_FILL
#error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout.
void test_entry_p003(val_api_t *val_api, psa_api_t *psa_api);
#endif

int main(void)
{
#ifdef ITS_TEST
    test_start(test_entry_s003);
#elif PS_TEST
    test_start(test_entry_p003);
#endif

}

<|next_version|>
#include "val_interfaces.h"
#include "pal_mbed_os_crypto.h"
#include "lifecycle.h"

#ifdef ITS_TEST
void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api);
#elif PS_TEST
#ifndef PS_ALLOW_ENTIRE_STORAGE_FILL
#error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout.
#endif
void test_entry_p003(val_api_t *val_api, psa_api_t *psa_api);
#endif

int main(void)
{
#ifdef ITS_TEST
    test_start(test_entry_s003);
#elif PS_TEST
    test_start(test_entry_p003);
#endif

}


Print sha1 of last commit

Print sha1 of last commit

--- test/test-file.c
+++ test/test-file.c
@@ -3,11 +3,13 @@

 #include <uuid/uuid.h>

+#include <wizbit/vref.h>
 #include <wizbit/file.h>

 int main()
 {
 	{
+		wiz_vref_hexbuffer buffer;
 		struct wiz_file *file;
 		wiz_vref vref;
 		FILE *fp;
@@ -31,6 +33,8 @@
 		wiz_file_add_parent(file, vref);
 		wiz_file_snapshot(file, vref);

+		printf("%s\n", wiz_vref_to_hex(vref, buffer));
+
 		wiz_file_close(file);
 	}

<|original_code|>
#include <glib.h>
#include <glib/gstdio.h>

#include <uuid/uuid.h>

#include <wizbit/file.h>

int main()
{
	{
		struct wiz_file *file;
		wiz_vref vref;
		FILE *fp;

		/*
		   Open up a new versioned file and create a couple
		   of revisions
		*/

		file = wiz_file_open(WIZ_FILE_NEW, 0, 0);
		fp = wiz_file_get_handle(file);

		fprintf(fp, "I BELIEVE");
		wiz_file_snapshot(file, vref);

		fprintf(fp, "\nNO RLY");
		wiz_file_add_parent(file, vref);
		wiz_file_snapshot(file, vref);

		fprintf(fp, "\nI CAN HAS BELIEVE!?");
		wiz_file_add_parent(file, vref);
		wiz_file_snapshot(file, vref);

		wiz_file_close(file);
	}

	return 0;
}

<|edits_diff|>
--- test/test-file.c
+++ test/test-file.c
@@ -3,11 +3,13 @@

 #include <uuid/uuid.h>

+#include <wizbit/vref.h>
 #include <wizbit/file.h>

 int main()
 {
 	{
+		wiz_vref_hexbuffer buffer;
 		struct wiz_file *file;
 		wiz_vref vref;
 		FILE *fp;
<|current_version|>
#include <glib.h>
#include <glib/gstdio.h>

#include <uuid/uuid.h>

#include <wizbit/vref.h>
#include <wizbit/file.h>

int main()
{
	{
		wiz_vref_hexbuffer buffer;
		struct wiz_file *file;
		wiz_vref vref;
		FILE *fp;

		/*
		   Open up a new versioned file and create a couple
		   of revisions
		*/

		file = wiz_file_open(WIZ_FILE_NEW, 0, 0);
		fp = wiz_file_get_handle(file);

		fprintf(fp, "I BELIEVE");
		wiz_file_snapshot(file, vref);

		fprintf(fp, "\nNO RLY");
		wiz_file_add_parent(file, vref);
		wiz_file_snapshot(file, vref);

		fprintf(fp, "\nI CAN HAS BELIEVE!?");
		wiz_file_add_parent(file, vref);
		wiz_file_snapshot(file, vref);

		wiz_file_close(file);
	}

	return 0;
}

<|next_version|>
#include <glib.h>
#include <glib/gstdio.h>

#include <uuid/uuid.h>

#include <wizbit/vref.h>
#include <wizbit/file.h>

int main()
{
	{
		wiz_vref_hexbuffer buffer;
		struct wiz_file *file;
		wiz_vref vref;
		FILE *fp;

		/*
		   Open up a new versioned file and create a couple
		   of revisions
		*/

		file = wiz_file_open(WIZ_FILE_NEW, 0, 0);
		fp = wiz_file_get_handle(file);

		fprintf(fp, "I BELIEVE");
		wiz_file_snapshot(file, vref);

		fprintf(fp, "\nNO RLY");
		wiz_file_add_parent(file, vref);
		wiz_file_snapshot(file, vref);

		fprintf(fp, "\nI CAN HAS BELIEVE!?");
		wiz_file_add_parent(file, vref);
		wiz_file_snapshot(file, vref);

		printf("%s\n", wiz_vref_to_hex(vref, buffer));

		wiz_file_close(file);
	}

	return 0;
}


Fix bootstrapping of GHC with earlier versions

We can no longer use atomic_inc() in the stage1 compiler because its
prototype was recently changed.

Since the stage1 compiler is always single-threaded, only use
atomic_inc() when THREADED_RTS is defined.

--- compiler/cbits/genSym.c
+++ compiler/cbits/genSym.c
@@ -4,10 +4,14 @@
 static HsInt GenSymCounter = 0;

 HsInt genSym(void) {
+#if defined(THREADED_RTS)
     if (n_capabilities == 1) {
         return GenSymCounter++;
     } else {
         return atomic_inc((StgWord *)&GenSymCounter, 1);
     }
+#else
+    return GenSymCounter++;
+#endif
 }

<|original_code|>

#include "Rts.h"

static HsInt GenSymCounter = 0;

HsInt genSym(void) {
    if (n_capabilities == 1) {
        return GenSymCounter++;
    } else {
        return atomic_inc((StgWord *)&GenSymCounter, 1);
    }
}

<|edits_diff|>
--- compiler/cbits/genSym.c
+++ compiler/cbits/genSym.c
@@ -4,6 +4,7 @@
 static HsInt GenSymCounter = 0;

 HsInt genSym(void) {
+#if defined(THREADED_RTS)
     if (n_capabilities == 1) {
         return GenSymCounter++;
     } else {
<|current_version|>

#include "Rts.h"

static HsInt GenSymCounter = 0;

HsInt genSym(void) {
#if defined(THREADED_RTS)
    if (n_capabilities == 1) {
        return GenSymCounter++;
    } else {
        return atomic_inc((StgWord *)&GenSymCounter, 1);
    }
}

<|next_version|>

#include "Rts.h"

static HsInt GenSymCounter = 0;

HsInt genSym(void) {
#if defined(THREADED_RTS)
    if (n_capabilities == 1) {
        return GenSymCounter++;
    } else {
        return atomic_inc((StgWord *)&GenSymCounter, 1);
    }
#else
    return GenSymCounter++;
#endif
}


Handle call with empty array gracefully. (Compare to segfault earlier).

--- ext/cowboy/cowboy.c
+++ ext/cowboy/cowboy.c
@@ -10,6 +10,9 @@
   Check_Type(nums, T_ARRAY);

   n = size_of_ary(nums);
+  if (n == 0){
+    rb_raise(rb_eException, "Can't use blank array");
+  }
   in = allocate_fftw_complex(n);
   out = allocate_fftw_complex(n);
   fp = fftw_plan_dft_1d(n, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
@@ -17,6 +20,7 @@
   cast_nums_to_complex(in, nums);

   fftw_execute(fp);
+  free(in);

   return complex_to_real_nums(out, n);
 }

<|original_code|>
#include "cowboy.h"

VALUE mCowboy;

VALUE fft_1d(VALUE m, VALUE nums){
  fftw_complex *in, *out;
  fftw_plan fp;
  long n;

  Check_Type(nums, T_ARRAY);

  n = size_of_ary(nums);
  in = allocate_fftw_complex(n);
  out = allocate_fftw_complex(n);
  fp = fftw_plan_dft_1d(n, in, out, FFTW_FORWARD, FFTW_ESTIMATE);

  cast_nums_to_complex(in, nums);

  fftw_execute(fp);

  return complex_to_real_nums(out, n);
}

void Init_cowboy(){
  mCowboy = rb_define_module("Cowboy");

  Init_cowboy_complex();

  rb_define_module_function(mCowboy, "fft_1d", fft_1d, 1);
}

<|edits_diff|>
--- ext/cowboy/cowboy.c
+++ ext/cowboy/cowboy.c
@@ -10,6 +10,9 @@
   Check_Type(nums, T_ARRAY);

   n = size_of_ary(nums);
+  if (n == 0){
+    rb_raise(rb_eException, "Can't use blank array");
+  }
   in = allocate_fftw_complex(n);
   out = allocate_fftw_complex(n);
   fp = fftw_plan_dft_1d(n, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
<|current_version|>
#include "cowboy.h"

VALUE mCowboy;

VALUE fft_1d(VALUE m, VALUE nums){
  fftw_complex *in, *out;
  fftw_plan fp;
  long n;

  Check_Type(nums, T_ARRAY);

  n = size_of_ary(nums);
  if (n == 0){
    rb_raise(rb_eException, "Can't use blank array");
  }
  in = allocate_fftw_complex(n);
  out = allocate_fftw_complex(n);
  fp = fftw_plan_dft_1d(n, in, out, FFTW_FORWARD, FFTW_ESTIMATE);

  cast_nums_to_complex(in, nums);

  fftw_execute(fp);

  return complex_to_real_nums(out, n);
}

void Init_cowboy(){
  mCowboy = rb_define_module("Cowboy");

  Init_cowboy_complex();

  rb_define_module_function(mCowboy, "fft_1d", fft_1d, 1);
}

<|next_version|>
#include "cowboy.h"

VALUE mCowboy;

VALUE fft_1d(VALUE m, VALUE nums){
  fftw_complex *in, *out;
  fftw_plan fp;
  long n;

  Check_Type(nums, T_ARRAY);

  n = size_of_ary(nums);
  if (n == 0){
    rb_raise(rb_eException, "Can't use blank array");
  }
  in = allocate_fftw_complex(n);
  out = allocate_fftw_complex(n);
  fp = fftw_plan_dft_1d(n, in, out, FFTW_FORWARD, FFTW_ESTIMATE);

  cast_nums_to_complex(in, nums);

  fftw_execute(fp);
  free(in);

  return complex_to_real_nums(out, n);
}

void Init_cowboy(){
  mCowboy = rb_define_module("Cowboy");

  Init_cowboy_complex();

  rb_define_module_function(mCowboy, "fft_1d", fft_1d, 1);
}


Add default calculation of horizontal & vertical position.

--- effects/startup.h
+++ effects/startup.h
@@ -7,8 +7,16 @@
 #define X(x) ((x) + 0x81)
 #endif

+#ifndef HP
+#define HP(x) (X(x) / 2)
+#endif
+
 #ifndef Y
 #define Y(y) ((y) + 0x2c)
+#endif
+
+#ifndef VP
+#define VP(y) (Y(y) & 255)
 #endif

 extern int frameCount;

<|original_code|>
#ifndef __STARTUP_H__
#define __STARTUP_H__

#include "types.h"

#ifndef X
#define X(x) ((x) + 0x81)
#endif

#ifndef Y
#define Y(y) ((y) + 0x2c)
#endif

extern int frameCount;
extern int lastFrameCount;
extern struct List *VBlankEvent;

typedef struct Effect {
  /* AmigaOS is active during this step. Loads resources from disk. */
  void (*Load)(void);
  /* Frees all resources allocated by "Load" step. */
  void (*UnLoad)(void);
  /*
   * Does all initialization steps required to launch the effect.
   * 1) Allocate required memory.
   * 2) Run all precalc routines.
   * 2) Generate copper lists.
   * 3) Set up interrupts and DMA channels.
   */
  void (*Init)(void);
  /* Frees all resources allocated by "Init" step. */
  void (*Kill)(void);
  /* Renders single frame of an effect. */
  void (*Render)(void);
  /* Handles all events and returns false to break the loop. */
  bool (*HandleEvent)(void);
} EffectT;

#endif

<|edits_diff|>
--- effects/startup.h
+++ effects/startup.h
@@ -5,6 +5,10 @@

 #ifndef X
 #define X(x) ((x) + 0x81)
+#endif
+
+#ifndef HP
+#define HP(x) (X(x) / 2)
 #endif

 #ifndef Y
<|current_version|>
#ifndef __STARTUP_H__
#define __STARTUP_H__

#include "types.h"

#ifndef X
#define X(x) ((x) + 0x81)
#endif

#ifndef HP
#define HP(x) (X(x) / 2)
#endif

#ifndef Y
#define Y(y) ((y) + 0x2c)
#endif

extern int frameCount;
extern int lastFrameCount;
extern struct List *VBlankEvent;

typedef struct Effect {
  /* AmigaOS is active during this step. Loads resources from disk. */
  void (*Load)(void);
  /* Frees all resources allocated by "Load" step. */
  void (*UnLoad)(void);
  /*
   * Does all initialization steps required to launch the effect.
   * 1) Allocate required memory.
   * 2) Run all precalc routines.
   * 2) Generate copper lists.
   * 3) Set up interrupts and DMA channels.
   */
  void (*Init)(void);
  /* Frees all resources allocated by "Init" step. */
  void (*Kill)(void);
  /* Renders single frame of an effect. */
  void (*Render)(void);
  /* Handles all events and returns false to break the loop. */
  bool (*HandleEvent)(void);
} EffectT;

#endif

<|next_version|>
#ifndef __STARTUP_H__
#define __STARTUP_H__

#include "types.h"

#ifndef X
#define X(x) ((x) + 0x81)
#endif

#ifndef HP
#define HP(x) (X(x) / 2)
#endif

#ifndef Y
#define Y(y) ((y) + 0x2c)
#endif

#ifndef VP
#define VP(y) (Y(y) & 255)
#endif

extern int frameCount;
extern int lastFrameCount;
extern struct List *VBlankEvent;

typedef struct Effect {
  /* AmigaOS is active during this step. Loads resources from disk. */
  void (*Load)(void);
  /* Frees all resources allocated by "Load" step. */
  void (*UnLoad)(void);
  /*
   * Does all initialization steps required to launch the effect.
   * 1) Allocate required memory.
   * 2) Run all precalc routines.
   * 2) Generate copper lists.
   * 3) Set up interrupts and DMA channels.
   */
  void (*Init)(void);
  /* Frees all resources allocated by "Init" step. */
  void (*Kill)(void);
  /* Renders single frame of an effect. */
  void (*Render)(void);
  /* Handles all events and returns false to break the loop. */
  bool (*HandleEvent)(void);
} EffectT;

#endif


Read keypresses from the user

Read keypresses from the user

--- kilo.c
+++ kilo.c
@@ -1,3 +1,7 @@
+#include <unistd.h>
+
 int main() {
+	char c;
+	while (read(STDIN_FILENO, &c, 1) == 1);
 	return 0;
 }

<|original_code|>
int main() {
	return 0;
}

<|edits_diff|>
--- kilo.c
+++ kilo.c
@@ -1,3 +1,5 @@
+#include <unistd.h>
+
 int main() {
 	return 0;
 }
<|current_version|>
#include <unistd.h>

int main() {
	return 0;
}

<|next_version|>
#include <unistd.h>

int main() {
	char c;
	while (read(STDIN_FILENO, &c, 1) == 1);
	return 0;
}


Allow to build with clang-cl

Allow to build with clang-cl

--- include/msvc_compat/C99/stdbool.h
+++ include/msvc_compat/C99/stdbool.h
@@ -5,7 +5,11 @@

 /* MSVC doesn't define _Bool or bool in C, but does have BOOL */
 /* Note this doesn't pass autoconf's test because (bool) 0.5 != true */
+/* Clang-cl uses MSVC headers, so needs msvc_compat, but has _Bool as
+ * a built-in type. */
+#ifndef __clang__
 typedef BOOL _Bool;
+#endif

 #define bool _Bool
 #define true 1

<|original_code|>
#ifndef stdbool_h
#define stdbool_h

#include <wtypes.h>

/* MSVC doesn't define _Bool or bool in C, but does have BOOL */
/* Note this doesn't pass autoconf's test because (bool) 0.5 != true */
typedef BOOL _Bool;

#define bool _Bool
#define true 1
#define false 0

#define __bool_true_false_are_defined 1

#endif /* stdbool_h */

<|edits_diff|>
--- include/msvc_compat/C99/stdbool.h
+++ include/msvc_compat/C99/stdbool.h
@@ -5,6 +5,9 @@

 /* MSVC doesn't define _Bool or bool in C, but does have BOOL */
 /* Note this doesn't pass autoconf's test because (bool) 0.5 != true */
+/* Clang-cl uses MSVC headers, so needs msvc_compat, but has _Bool as
+ * a built-in type. */
+#ifndef __clang__
 typedef BOOL _Bool;

 #define bool _Bool
<|current_version|>
#ifndef stdbool_h
#define stdbool_h

#include <wtypes.h>

/* MSVC doesn't define _Bool or bool in C, but does have BOOL */
/* Note this doesn't pass autoconf's test because (bool) 0.5 != true */
/* Clang-cl uses MSVC headers, so needs msvc_compat, but has _Bool as
 * a built-in type. */
#ifndef __clang__
typedef BOOL _Bool;

#define bool _Bool
#define true 1
#define false 0

#define __bool_true_false_are_defined 1

#endif /* stdbool_h */

<|next_version|>
#ifndef stdbool_h
#define stdbool_h

#include <wtypes.h>

/* MSVC doesn't define _Bool or bool in C, but does have BOOL */
/* Note this doesn't pass autoconf's test because (bool) 0.5 != true */
/* Clang-cl uses MSVC headers, so needs msvc_compat, but has _Bool as
 * a built-in type. */
#ifndef __clang__
typedef BOOL _Bool;
#endif

#define bool _Bool
#define true 1
#define false 0

#define __bool_true_false_are_defined 1

#endif /* stdbool_h */


Add text output for integers.

Add text output for integers.

--- formats/custom-type.c
+++ formats/custom-type.c
@@ -12,6 +12,8 @@
 	redisReply *reply = r;
 	struct cmd *cmd = privdata;
 	(void)c;
+	char int_buffer[50];
+	int int_len;

 	if(reply == NULL) {
 		evhttp_send_reply(cmd->rq, 404, "Not Found", NULL);
@@ -28,6 +30,11 @@
 			case REDIS_REPLY_STRING:
 				format_send_reply(cmd, reply->str, reply->len, cmd->mime);
 				return;
+
+			case REDIS_REPLY_INTEGER:
+				int_len = sprintf(int_buffer, "%lld", reply->integer);
+				format_send_reply(cmd, int_buffer, int_len, cmd->mime);
+				return;
 		}
 	}

<|original_code|>
#include "custom-type.h"
#include "cmd.h"
#include "common.h"

#include <string.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>

void
custom_type_reply(redisAsyncContext *c, void *r, void *privdata) {

	redisReply *reply = r;
	struct cmd *cmd = privdata;
	(void)c;

	if(reply == NULL) {
		evhttp_send_reply(cmd->rq, 404, "Not Found", NULL);
		return;
	}

	if(cmd->mime) { /* use the given content-type, but only for strings */
		switch(reply->type) {

			case REDIS_REPLY_NIL: /* or nil values */
				format_send_reply(cmd, "", 0, cmd->mime);
				return;

			case REDIS_REPLY_STRING:
				format_send_reply(cmd, reply->str, reply->len, cmd->mime);
				return;
		}
	}

	/* couldn't make sense of what the client wanted. */
	evhttp_send_reply(cmd->rq, 400, "Bad request", NULL);
	cmd_free(cmd);
}

<|edits_diff|>
--- formats/custom-type.c
+++ formats/custom-type.c
@@ -12,6 +12,8 @@
 	redisReply *reply = r;
 	struct cmd *cmd = privdata;
 	(void)c;
+	char int_buffer[50];
+	int int_len;

 	if(reply == NULL) {
 		evhttp_send_reply(cmd->rq, 404, "Not Found", NULL);
<|current_version|>
#include "custom-type.h"
#include "cmd.h"
#include "common.h"

#include <string.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>

void
custom_type_reply(redisAsyncContext *c, void *r, void *privdata) {

	redisReply *reply = r;
	struct cmd *cmd = privdata;
	(void)c;
	char int_buffer[50];
	int int_len;

	if(reply == NULL) {
		evhttp_send_reply(cmd->rq, 404, "Not Found", NULL);
		return;
	}

	if(cmd->mime) { /* use the given content-type, but only for strings */
		switch(reply->type) {

			case REDIS_REPLY_NIL: /* or nil values */
				format_send_reply(cmd, "", 0, cmd->mime);
				return;

			case REDIS_REPLY_STRING:
				format_send_reply(cmd, reply->str, reply->len, cmd->mime);
				return;
		}
	}

	/* couldn't make sense of what the client wanted. */
	evhttp_send_reply(cmd->rq, 400, "Bad request", NULL);
	cmd_free(cmd);
}

<|next_version|>
#include "custom-type.h"
#include "cmd.h"
#include "common.h"

#include <string.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>

void
custom_type_reply(redisAsyncContext *c, void *r, void *privdata) {

	redisReply *reply = r;
	struct cmd *cmd = privdata;
	(void)c;
	char int_buffer[50];
	int int_len;

	if(reply == NULL) {
		evhttp_send_reply(cmd->rq, 404, "Not Found", NULL);
		return;
	}

	if(cmd->mime) { /* use the given content-type, but only for strings */
		switch(reply->type) {

			case REDIS_REPLY_NIL: /* or nil values */
				format_send_reply(cmd, "", 0, cmd->mime);
				return;

			case REDIS_REPLY_STRING:
				format_send_reply(cmd, reply->str, reply->len, cmd->mime);
				return;

			case REDIS_REPLY_INTEGER:
				int_len = sprintf(int_buffer, "%lld", reply->integer);
				format_send_reply(cmd, int_buffer, int_len, cmd->mime);
				return;
		}
	}

	/* couldn't make sense of what the client wanted. */
	evhttp_send_reply(cmd->rq, 400, "Bad request", NULL);
	cmd_free(cmd);
}


Make test subsystem load itself properly

--- testmud/mud/home/Test/initd.c
+++ testmud/mud/home/Test/initd.c
@@ -21,8 +21,14 @@
 #include <kotaka/paths.h>

 inherit LIB_INITD;
+inherit UTILITY_COMPILE;

 static void create()
 {
+	LOGD->post_message("test", LOG_DEBUG, "Test subsystem loading...");
+
+	load_dir("obj", 1);
+	load_dir("sys", 1);
+
 	LOGD->post_message("test", LOG_DEBUG, "Test subsystem loaded");
 }

<|original_code|>
/*
 * This file is part of Kotaka, a mud library for DGD
 * http://github.com/shentino/kotaka
 *
 * Copyright (C) 2012  Raymond Jennings
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include <kotaka/log.h>
#include <kotaka/paths.h>

inherit LIB_INITD;

static void create()
{
	LOGD->post_message("test", LOG_DEBUG, "Test subsystem loaded");
}

<|edits_diff|>
--- testmud/mud/home/Test/initd.c
+++ testmud/mud/home/Test/initd.c
@@ -21,6 +21,7 @@
 #include <kotaka/paths.h>

 inherit LIB_INITD;
+inherit UTILITY_COMPILE;

 static void create()
 {
<|current_version|>
/*
 * This file is part of Kotaka, a mud library for DGD
 * http://github.com/shentino/kotaka
 *
 * Copyright (C) 2012  Raymond Jennings
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include <kotaka/log.h>
#include <kotaka/paths.h>

inherit LIB_INITD;
inherit UTILITY_COMPILE;

static void create()
{
	LOGD->post_message("test", LOG_DEBUG, "Test subsystem loaded");
}

<|next_version|>
/*
 * This file is part of Kotaka, a mud library for DGD
 * http://github.com/shentino/kotaka
 *
 * Copyright (C) 2012  Raymond Jennings
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include <kotaka/log.h>
#include <kotaka/paths.h>

inherit LIB_INITD;
inherit UTILITY_COMPILE;

static void create()
{
	LOGD->post_message("test", LOG_DEBUG, "Test subsystem loading...");

	load_dir("obj", 1);
	load_dir("sys", 1);

	LOGD->post_message("test", LOG_DEBUG, "Test subsystem loaded");
}


Create a type to cast Ruby's C functions to a thing C++ is happy with.

--- ext/pdfium_ruby/pdfium_ruby.h
+++ ext/pdfium_ruby/pdfium_ruby.h
@@ -1,7 +1,16 @@
+#ifndef __PDFIUM_RUBY_H__
+#define __PDFIUM_RUBY_H__
+
 extern "C" {
   #include "ruby.h"
 }

+// Inspired by https://github.com/jasonroelofs/rice/blob/1740a6d12c99fce8c21eda3c5385738318ab9172/rice/detail/ruby.hpp#L33-L37
+// Casts C functions into a type that C++ is happy calling
+extern "C" typedef VALUE (*CPP_RUBY_METHOD_FUNC)(ANYARGS);
+
 void Define_Document();
 void Define_Page();
 void Define_PageSet();
+
+#endif

<|original_code|>
extern "C" {
  #include "ruby.h"
}

void Define_Document();
void Define_Page();
void Define_PageSet();

<|edits_diff|>
--- ext/pdfium_ruby/pdfium_ruby.h
+++ ext/pdfium_ruby/pdfium_ruby.h
@@ -1,7 +1,14 @@
+#ifndef __PDFIUM_RUBY_H__
+#define __PDFIUM_RUBY_H__
+
 extern "C" {
   #include "ruby.h"
 }

+// Inspired by https://github.com/jasonroelofs/rice/blob/1740a6d12c99fce8c21eda3c5385738318ab9172/rice/detail/ruby.hpp#L33-L37
+// Casts C functions into a type that C++ is happy calling
+extern "C" typedef VALUE (*CPP_RUBY_METHOD_FUNC)(ANYARGS);
+
 void Define_Document();
 void Define_Page();
 void Define_PageSet();
<|current_version|>
#ifndef __PDFIUM_RUBY_H__
#define __PDFIUM_RUBY_H__

extern "C" {
  #include "ruby.h"
}

// Inspired by https://github.com/jasonroelofs/rice/blob/1740a6d12c99fce8c21eda3c5385738318ab9172/rice/detail/ruby.hpp#L33-L37
// Casts C functions into a type that C++ is happy calling
extern "C" typedef VALUE (*CPP_RUBY_METHOD_FUNC)(ANYARGS);

void Define_Document();
void Define_Page();
void Define_PageSet();

<|next_version|>
#ifndef __PDFIUM_RUBY_H__
#define __PDFIUM_RUBY_H__

extern "C" {
  #include "ruby.h"
}

// Inspired by https://github.com/jasonroelofs/rice/blob/1740a6d12c99fce8c21eda3c5385738318ab9172/rice/detail/ruby.hpp#L33-L37
// Casts C functions into a type that C++ is happy calling
extern "C" typedef VALUE (*CPP_RUBY_METHOD_FUNC)(ANYARGS);

void Define_Document();
void Define_Page();
void Define_PageSet();

#endif


Add another case to qualifier-removal test

--- test2/casts/rm_qual.c
+++ test2/casts/rm_qual.c
@@ -4,6 +4,8 @@
 {
 	int i;
 };
+
+void take(void *);

 int f(const void *p)
 {
@@ -12,4 +14,7 @@

 	(void)a;
 	(void)b;
+
+	const char c = 5;
+	take(&c); // CHECK: warning: implicit cast removes qualifiers (const)
 }

<|original_code|>
// RUN: %check %s

struct A
{
	int i;
};

int f(const void *p)
{
	struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const)
	struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/

	(void)a;
	(void)b;
}

<|edits_diff|>
--- test2/casts/rm_qual.c
+++ test2/casts/rm_qual.c
@@ -4,6 +4,8 @@
 {
 	int i;
 };
+
+void take(void *);

 int f(const void *p)
 {
<|current_version|>
// RUN: %check %s

struct A
{
	int i;
};

void take(void *);

int f(const void *p)
{
	struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const)
	struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/

	(void)a;
	(void)b;
}

<|next_version|>
// RUN: %check %s

struct A
{
	int i;
};

void take(void *);

int f(const void *p)
{
	struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const)
	struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/

	(void)a;
	(void)b;

	const char c = 5;
	take(&c); // CHECK: warning: implicit cast removes qualifiers (const)
}


Update testcase to show that we don't emit an error for sizes <= 32-bits.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@167748 91177308-0d34-0410-b5e6-96231b3b80d8

--- test/CodeGen/x86_32-inline-asm.c
+++ test/CodeGen/x86_32-inline-asm.c
@@ -8,6 +8,7 @@
 typedef u_int64_t uint64_t;

 int main () {
+  // Error out if size is > 32-bits.
   uint32_t msr = 0x8b;
   uint64_t val = 0;
   __asm__ volatile("wrmsr"
@@ -15,4 +16,9 @@
                    : "c" (msr),
                      "a" ((val & 0xFFFFFFFFUL)), // expected-error {{invalid input size for constraint 'a'}}
                      "d" (((val >> 32) & 0xFFFFFFFFUL)));
+
+  // Don't error out if the size of the destination is <= 32 bits.
+  unsigned char data;
+  unsigned int port;
+  __asm__ volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); // No error expected.
 }

<|original_code|>
// RUN: %clang_cc1 -triple i386-apple-darwin9 -verify %s
// <rdar://problem/12415959>

typedef unsigned int u_int32_t;
typedef u_int32_t uint32_t;

typedef unsigned long long u_int64_t;
typedef u_int64_t uint64_t;

int main () {
  uint32_t msr = 0x8b;
  uint64_t val = 0;
  __asm__ volatile("wrmsr"
                   :
                   : "c" (msr),
                     "a" ((val & 0xFFFFFFFFUL)), // expected-error {{invalid input size for constraint 'a'}}
                     "d" (((val >> 32) & 0xFFFFFFFFUL)));
}

<|edits_diff|>
--- test/CodeGen/x86_32-inline-asm.c
+++ test/CodeGen/x86_32-inline-asm.c
@@ -8,6 +8,7 @@
 typedef u_int64_t uint64_t;

 int main () {
+  // Error out if size is > 32-bits.
   uint32_t msr = 0x8b;
   uint64_t val = 0;
   __asm__ volatile("wrmsr"
<|current_version|>
// RUN: %clang_cc1 -triple i386-apple-darwin9 -verify %s
// <rdar://problem/12415959>

typedef unsigned int u_int32_t;
typedef u_int32_t uint32_t;

typedef unsigned long long u_int64_t;
typedef u_int64_t uint64_t;

int main () {
  // Error out if size is > 32-bits.
  uint32_t msr = 0x8b;
  uint64_t val = 0;
  __asm__ volatile("wrmsr"
                   :
                   : "c" (msr),
                     "a" ((val & 0xFFFFFFFFUL)), // expected-error {{invalid input size for constraint 'a'}}
                     "d" (((val >> 32) & 0xFFFFFFFFUL)));
}

<|next_version|>
// RUN: %clang_cc1 -triple i386-apple-darwin9 -verify %s
// <rdar://problem/12415959>

typedef unsigned int u_int32_t;
typedef u_int32_t uint32_t;

typedef unsigned long long u_int64_t;
typedef u_int64_t uint64_t;

int main () {
  // Error out if size is > 32-bits.
  uint32_t msr = 0x8b;
  uint64_t val = 0;
  __asm__ volatile("wrmsr"
                   :
                   : "c" (msr),
                     "a" ((val & 0xFFFFFFFFUL)), // expected-error {{invalid input size for constraint 'a'}}
                     "d" (((val >> 32) & 0xFFFFFFFFUL)));

  // Don't error out if the size of the destination is <= 32 bits.
  unsigned char data;
  unsigned int port;
  __asm__ volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); // No error expected.
}


Add documentation comments for method

Add documentation comments for method

--- Classes/NAPlaybackIndicatorView.h
+++ Classes/NAPlaybackIndicatorView.h
@@ -10,9 +10,19 @@

 @interface NAPlaybackIndicatorView : UIView

+/**
+ Starts the oscillating animation of the bars.
+ */
 - (void)startAnimating;
+
+/**
+ Stop the oscillating animation of the bars.
+ */
 - (void)stopAnimating;

+/**
+ Whether the receiver is animating.
+ */
 @property (nonatomic, readonly, getter=isAnimating) BOOL animating;

 @end

<|original_code|>
//
//  NAPlaybackIndicatorView.h
//  PlaybackIndicator
//
//  Created by Yuji Nakayama on 1/27/14.
//  Copyright (c) 2014 Yuji Nakayama. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NAPlaybackIndicatorView : UIView

- (void)startAnimating;
- (void)stopAnimating;

@property (nonatomic, readonly, getter=isAnimating) BOOL animating;

@end

<|edits_diff|>
--- Classes/NAPlaybackIndicatorView.h
+++ Classes/NAPlaybackIndicatorView.h
@@ -10,7 +10,14 @@

 @interface NAPlaybackIndicatorView : UIView

+/**
+ Starts the oscillating animation of the bars.
+ */
 - (void)startAnimating;
+
+/**
+ Stop the oscillating animation of the bars.
+ */
 - (void)stopAnimating;

 @property (nonatomic, readonly, getter=isAnimating) BOOL animating;
<|current_version|>
//
//  NAPlaybackIndicatorView.h
//  PlaybackIndicator
//
//  Created by Yuji Nakayama on 1/27/14.
//  Copyright (c) 2014 Yuji Nakayama. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NAPlaybackIndicatorView : UIView

/**
 Starts the oscillating animation of the bars.
 */
- (void)startAnimating;

/**
 Stop the oscillating animation of the bars.
 */
- (void)stopAnimating;

@property (nonatomic, readonly, getter=isAnimating) BOOL animating;

@end

<|next_version|>
//
//  NAPlaybackIndicatorView.h
//  PlaybackIndicator
//
//  Created by Yuji Nakayama on 1/27/14.
//  Copyright (c) 2014 Yuji Nakayama. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NAPlaybackIndicatorView : UIView

/**
 Starts the oscillating animation of the bars.
 */
- (void)startAnimating;

/**
 Stop the oscillating animation of the bars.
 */
- (void)stopAnimating;

/**
 Whether the receiver is animating.
 */
@property (nonatomic, readonly, getter=isAnimating) BOOL animating;

@end


Expand web::BrowserState to add GetPath() method

Add a method to web::BrowserState returning the path where the
BrowserState data is stored.

BUG=429756

Review URL: https://codereview.chromium.org/740353002

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#305191}

--- ios/web/public/browser_state.h
+++ ios/web/public/browser_state.h
@@ -6,6 +6,10 @@
 #define IOS_WEB_PUBLIC_BROWSER_STATE_H_

 #include "base/supports_user_data.h"
+
+namespace base {
+class FilePath;
+}

 namespace net {
 class URLRequestContextGetter;
@@ -23,6 +27,9 @@
   // Return whether this BrowserState is incognito. Default is false.
   virtual bool IsOffTheRecord() const = 0;

+  // Retrieves the path where the BrowserState data is stored.
+  virtual base::FilePath GetPath() const = 0;
+
   // Returns the request context information associated with this
   // BrowserState.
   virtual net::URLRequestContextGetter* GetRequestContext() = 0;

<|original_code|>
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_

#include "base/supports_user_data.h"

namespace net {
class URLRequestContextGetter;
}

namespace web {

// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class BrowserState : public base::SupportsUserData {
 public:
  ~BrowserState() override;

  // Return whether this BrowserState is incognito. Default is false.
  virtual bool IsOffTheRecord() const = 0;

  // Returns the request context information associated with this
  // BrowserState.
  virtual net::URLRequestContextGetter* GetRequestContext() = 0;

 protected:
  BrowserState();
};

}  // namespace web

#endif  // IOS_WEB_PUBLIC_BROWSER_STATE_H_

<|edits_diff|>
--- ios/web/public/browser_state.h
+++ ios/web/public/browser_state.h
@@ -6,6 +6,10 @@
 #define IOS_WEB_PUBLIC_BROWSER_STATE_H_

 #include "base/supports_user_data.h"
+
+namespace base {
+class FilePath;
+}

 namespace net {
 class URLRequestContextGetter;
<|current_version|>
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_

#include "base/supports_user_data.h"

namespace base {
class FilePath;
}

namespace net {
class URLRequestContextGetter;
}

namespace web {

// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class BrowserState : public base::SupportsUserData {
 public:
  ~BrowserState() override;

  // Return whether this BrowserState is incognito. Default is false.
  virtual bool IsOffTheRecord() const = 0;

  // Returns the request context information associated with this
  // BrowserState.
  virtual net::URLRequestContextGetter* GetRequestContext() = 0;

 protected:
  BrowserState();
};

}  // namespace web

#endif  // IOS_WEB_PUBLIC_BROWSER_STATE_H_

<|next_version|>
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_

#include "base/supports_user_data.h"

namespace base {
class FilePath;
}

namespace net {
class URLRequestContextGetter;
}

namespace web {

// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class BrowserState : public base::SupportsUserData {
 public:
  ~BrowserState() override;

  // Return whether this BrowserState is incognito. Default is false.
  virtual bool IsOffTheRecord() const = 0;

  // Retrieves the path where the BrowserState data is stored.
  virtual base::FilePath GetPath() const = 0;

  // Returns the request context information associated with this
  // BrowserState.
  virtual net::URLRequestContextGetter* GetRequestContext() = 0;

 protected:
  BrowserState();
};

}  // namespace web

#endif  // IOS_WEB_PUBLIC_BROWSER_STATE_H_


Add new attributes to Visit class

Add new attributes to Visit class

--- OpenMRS-iOS/MRSVisit.h
+++ OpenMRS-iOS/MRSVisit.h
@@ -7,9 +7,14 @@
 //

 #import <Foundation/Foundation.h>
+#import "MRSLocation.h"

+@class MRSVisitType;
 @interface MRSVisit : NSObject
 @property (nonatomic, strong) NSString *displayName;
 @property (nonatomic, strong) NSString *UUID;
+@property (nonatomic, strong) NSString *startDateTime;
+@property (nonatomic, strong) MRSVisitType *visitType;
+@property (nonatomic, strong) MRSLocation *location;
 @property (nonatomic) BOOL active;
 @end

<|original_code|>
//
//  MRSVisit.h
//  OpenMRS-iOS
//
//  Created by Parker Erway on 12/2/14.
//  Copyright (c) 2014 Erway Software. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface MRSVisit : NSObject
@property (nonatomic, strong) NSString *displayName;
@property (nonatomic, strong) NSString *UUID;
@property (nonatomic) BOOL active;
@end

<|edits_diff|>
--- OpenMRS-iOS/MRSVisit.h
+++ OpenMRS-iOS/MRSVisit.h
@@ -7,7 +7,9 @@
 //

 #import <Foundation/Foundation.h>
+#import "MRSLocation.h"

+@class MRSVisitType;
 @interface MRSVisit : NSObject
 @property (nonatomic, strong) NSString *displayName;
 @property (nonatomic, strong) NSString *UUID;
<|current_version|>
//
//  MRSVisit.h
//  OpenMRS-iOS
//
//  Created by Parker Erway on 12/2/14.
//  Copyright (c) 2014 Erway Software. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MRSLocation.h"

@class MRSVisitType;
@interface MRSVisit : NSObject
@property (nonatomic, strong) NSString *displayName;
@property (nonatomic, strong) NSString *UUID;
@property (nonatomic) BOOL active;
@end

<|next_version|>
//
//  MRSVisit.h
//  OpenMRS-iOS
//
//  Created by Parker Erway on 12/2/14.
//  Copyright (c) 2014 Erway Software. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MRSLocation.h"

@class MRSVisitType;
@interface MRSVisit : NSObject
@property (nonatomic, strong) NSString *displayName;
@property (nonatomic, strong) NSString *UUID;
@property (nonatomic, strong) NSString *startDateTime;
@property (nonatomic, strong) MRSVisitType *visitType;
@property (nonatomic, strong) MRSLocation *location;
@property (nonatomic) BOOL active;
@end


Add paralellism with race conditions to omp

--- ps4/histogram_omp.c
+++ ps4/histogram_omp.c
@@ -21,12 +21,14 @@

     int* histogram = (int*)calloc(sizeof(int), color_depth);
+    #pragma omp parallel for
     for(int i = 0; i < image_size; i++){
         histogram[image[i]]++;
     }

     float* transfer_function = (float*)calloc(sizeof(float), color_depth);
+    #pragma omp parallel for
     for(int i = 0; i < color_depth; i++){
         for(int j = 0; j < i+1; j++){
             transfer_function[i] += color_depth*((float)histogram[j])/(image_size);

<|original_code|>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bmp.h"

const int image_width = 512;
const int image_height = 512;
const int image_size = 512*512;
const int color_depth = 255;

int main(int argc, char** argv){

    if(argc != 3){
        printf("Useage: %s image n_threads\n", argv[0]);
        exit(-1);
    }
    int n_threads = atoi(argv[2]);

    unsigned char* image = read_bmp(argv[1]);
    unsigned char* output_image = malloc(sizeof(unsigned char) * image_size);

    int* histogram = (int*)calloc(sizeof(int), color_depth);
    for(int i = 0; i < image_size; i++){
        histogram[image[i]]++;
    }

    float* transfer_function = (float*)calloc(sizeof(float), color_depth);
    for(int i = 0; i < color_depth; i++){
        for(int j = 0; j < i+1; j++){
            transfer_function[i] += color_depth*((float)histogram[j])/(image_size);
        }
    }

    for(int i = 0; i < image_size; i++){
        output_image[i] = transfer_function[image[i]];
    }

    write_bmp(output_image, image_width, image_height);
}

<|edits_diff|>
--- ps4/histogram_omp.c
+++ ps4/histogram_omp.c
@@ -21,6 +21,7 @@

     int* histogram = (int*)calloc(sizeof(int), color_depth);
+    #pragma omp parallel for
     for(int i = 0; i < image_size; i++){
         histogram[image[i]]++;
     }
<|current_version|>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bmp.h"

const int image_width = 512;
const int image_height = 512;
const int image_size = 512*512;
const int color_depth = 255;

int main(int argc, char** argv){

    if(argc != 3){
        printf("Useage: %s image n_threads\n", argv[0]);
        exit(-1);
    }
    int n_threads = atoi(argv[2]);

    unsigned char* image = read_bmp(argv[1]);
    unsigned char* output_image = malloc(sizeof(unsigned char) * image_size);

    int* histogram = (int*)calloc(sizeof(int), color_depth);
    #pragma omp parallel for
    for(int i = 0; i < image_size; i++){
        histogram[image[i]]++;
    }

    float* transfer_function = (float*)calloc(sizeof(float), color_depth);
    for(int i = 0; i < color_depth; i++){
        for(int j = 0; j < i+1; j++){
            transfer_function[i] += color_depth*((float)histogram[j])/(image_size);
        }
    }

    for(int i = 0; i < image_size; i++){
        output_image[i] = transfer_function[image[i]];
    }

    write_bmp(output_image, image_width, image_height);
}

<|next_version|>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bmp.h"

const int image_width = 512;
const int image_height = 512;
const int image_size = 512*512;
const int color_depth = 255;

int main(int argc, char** argv){

    if(argc != 3){
        printf("Useage: %s image n_threads\n", argv[0]);
        exit(-1);
    }
    int n_threads = atoi(argv[2]);

    unsigned char* image = read_bmp(argv[1]);
    unsigned char* output_image = malloc(sizeof(unsigned char) * image_size);

    int* histogram = (int*)calloc(sizeof(int), color_depth);
    #pragma omp parallel for
    for(int i = 0; i < image_size; i++){
        histogram[image[i]]++;
    }

    float* transfer_function = (float*)calloc(sizeof(float), color_depth);
    #pragma omp parallel for
    for(int i = 0; i < color_depth; i++){
        for(int j = 0; j < i+1; j++){
            transfer_function[i] += color_depth*((float)histogram[j])/(image_size);
        }
    }

    for(int i = 0; i < image_size; i++){
        output_image[i] = transfer_function[image[i]];
    }

    write_bmp(output_image, image_width, image_height);
}


Add divider constructor with interval default argument

--- src/Console.h
+++ src/Console.h
@@ -9,6 +9,9 @@

 class Divider {
 public:
+    Divider(int interval = 1) {
+	setInterval(interval);
+    }
     void setInterval(int interval) {
 	this->interval = interval;
 	clockCounter = interval - 1;
@@ -22,6 +25,7 @@
     bool hasClocked() {
 	return clockCounter == 0;
     }
+
 private:
     int interval;
     int clockCounter;

<|original_code|>
#ifndef CONSOLE_H
#define CONSOLE_H

#include <Cart.h>
#include <Controller.h>
#include <CPU.h>
#include <PPU.h>
#include <APU.h>

class Divider {
public:
    void setInterval(int interval) {
	this->interval = interval;
	clockCounter = interval - 1;
    }
    void tick() {
	clockCounter++;
	if (clockCounter == interval) {
	    clockCounter = 0;
	}
    }
    bool hasClocked() {
	return clockCounter == 0;
    }
private:
    int interval;
    int clockCounter;
};

class Console {
public:
  ~Console();
  void boot();
  void runForOneFrame();
  uint32_t *getFrameBuffer();

  Cart cart;
  Controller controller1;

private:
  void tick();

  CPU *cpu;
  PPU *ppu;
  APU apu;
  Divider cpuDivider;
};

#endif

<|edits_diff|>
--- src/Console.h
+++ src/Console.h
@@ -9,6 +9,9 @@

 class Divider {
 public:
+    Divider(int interval = 1) {
+	setInterval(interval);
+    }
     void setInterval(int interval) {
 	this->interval = interval;
 	clockCounter = interval - 1;
<|current_version|>
#ifndef CONSOLE_H
#define CONSOLE_H

#include <Cart.h>
#include <Controller.h>
#include <CPU.h>
#include <PPU.h>
#include <APU.h>

class Divider {
public:
    Divider(int interval = 1) {
	setInterval(interval);
    }
    void setInterval(int interval) {
	this->interval = interval;
	clockCounter = interval - 1;
    }
    void tick() {
	clockCounter++;
	if (clockCounter == interval) {
	    clockCounter = 0;
	}
    }
    bool hasClocked() {
	return clockCounter == 0;
    }
private:
    int interval;
    int clockCounter;
};

class Console {
public:
  ~Console();
  void boot();
  void runForOneFrame();
  uint32_t *getFrameBuffer();

  Cart cart;
  Controller controller1;

private:
  void tick();

  CPU *cpu;
  PPU *ppu;
  APU apu;
  Divider cpuDivider;
};

#endif

<|next_version|>
#ifndef CONSOLE_H
#define CONSOLE_H

#include <Cart.h>
#include <Controller.h>
#include <CPU.h>
#include <PPU.h>
#include <APU.h>

class Divider {
public:
    Divider(int interval = 1) {
	setInterval(interval);
    }
    void setInterval(int interval) {
	this->interval = interval;
	clockCounter = interval - 1;
    }
    void tick() {
	clockCounter++;
	if (clockCounter == interval) {
	    clockCounter = 0;
	}
    }
    bool hasClocked() {
	return clockCounter == 0;
    }

private:
    int interval;
    int clockCounter;
};

class Console {
public:
  ~Console();
  void boot();
  void runForOneFrame();
  uint32_t *getFrameBuffer();

  Cart cart;
  Controller controller1;

private:
  void tick();

  CPU *cpu;
  PPU *ppu;
  APU apu;
  Divider cpuDivider;
};

#endif


Add a missing include guard

Add a missing include guard

--- ext/osl/rbosl_move.h
+++ ext/osl/rbosl_move.h
@@ -1,3 +1,6 @@
+#ifndef RBOSL_MOVE_H
+#define RBOSL_MOVE_H
+
 #include "ruby.h"
 #include <osl/move.h>

@@ -9,3 +12,5 @@
 static VALUE rb_move_s_new(VALUE self);

 void Init_move(void);
+
+#endif /* RBOSL_MOVE_H */

<|original_code|>
#include "ruby.h"
#include <osl/move.h>

extern  VALUE cMove;

using namespace osl;

void rb_move_free(Move* ptr);
static VALUE rb_move_s_new(VALUE self);

void Init_move(void);

<|edits_diff|>
--- ext/osl/rbosl_move.h
+++ ext/osl/rbosl_move.h
@@ -1,3 +1,6 @@
+#ifndef RBOSL_MOVE_H
+#define RBOSL_MOVE_H
+
 #include "ruby.h"
 #include <osl/move.h>

<|current_version|>
#ifndef RBOSL_MOVE_H
#define RBOSL_MOVE_H

#include "ruby.h"
#include <osl/move.h>

extern  VALUE cMove;

using namespace osl;

void rb_move_free(Move* ptr);
static VALUE rb_move_s_new(VALUE self);

void Init_move(void);

<|next_version|>
#ifndef RBOSL_MOVE_H
#define RBOSL_MOVE_H

#include "ruby.h"
#include <osl/move.h>

extern  VALUE cMove;

using namespace osl;

void rb_move_free(Move* ptr);
static VALUE rb_move_s_new(VALUE self);

void Init_move(void);

#endif /* RBOSL_MOVE_H */