Change alAuxEffectSlot.c to the new error handling

--- OpenAL32/alAuxEffectSlot.c
+++ OpenAL32/alAuxEffectSlot.c
@@ -32,67 +32,58 @@
 #include "alSource.h"

-static ALenum ResizeEffectSlotArray(ALCcontext *Context, ALsizei count);
-static ALvoid RemoveEffectSlotArray(ALCcontext *Context, ALeffectslot *val);
+static ALenum AddEffectSlotArray(ALCcontext *Context, ALsizei count, const ALuint *slots);
+static ALvoid RemoveEffectSlotArray(ALCcontext *Context, ALeffectslot *slot);

 AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots)
 {
     ALCcontext *Context;
-
-    Context = GetContextRef();
-    if(!Context) return;
-
-    if(n < 0 || IsBadWritePtr((void*)effectslots, n * sizeof(ALuint)))
-        alSetError(Context, AL_INVALID_VALUE);
-    else
+    ALsizei    cur = 0;
+
+    Context = GetContextRef();
+    if(!Context) return;
+
+    al_try
     {
         ALenum err;
-        ALsizei i;
-
-        err = ResizeEffectSlotArray(Context, n);
-        if(err != AL_NO_ERROR)
-        {
-            alSetError(Context, err);
-            n = 0;
-        }
-
-        for(i = 0;i < n;i++)
+
+        CHECK_VALUE(Context, n >= 0);
+        for(cur = 0;cur < n;cur++)
         {
             ALeffectslot *slot = calloc(1, sizeof(ALeffectslot));
-            if(!slot || InitEffectSlot(slot) != AL_NO_ERROR)
+            err = AL_OUT_OF_MEMORY;
+            if(!slot || (err=InitEffectSlot(slot)) != AL_NO_ERROR)
             {
                 free(slot);
-                // We must have run out or memory
-                alSetError(Context, AL_OUT_OF_MEMORY);
-                alDeleteAuxiliaryEffectSlots(i, effectslots);
+                al_throwerr(Context, err);
                 break;
             }

-            LockContext(Context);
-            err = ResizeEffectSlotArray(Context, 1);
-            if(err == AL_NO_ERROR)
-                Context->ActiveEffectSlots[Context->ActiveEffectSlotCount++] = slot;
-            UnlockContext(Context);
-            if(err == AL_NO_ERROR)
-                err = NewThunkEntry(&slot->id);
+            err = NewThunkEntry(&slot->id);
             if(err == AL_NO_ERROR)
                 err = InsertUIntMapEntry(&Context->EffectSlotMap, slot->id, slot);
             if(err != AL_NO_ERROR)
             {
-                RemoveEffectSlotArray(Context, slot);
                 FreeThunkEntry(slot->id);
                 ALeffectState_Destroy(slot->EffectState);
                 free(slot);

-                alSetError(Context, err);
-                alDeleteAuxiliaryEffectSlots(i, effectslots);
-                break;
+                al_throwerr(Context, err);
             }

-            effectslots[i] = slot->id;
-        }
-    }
+            effectslots[cur] = slot->id;
+        }
+        err = AddEffectSlotArray(Context, n, effectslots);
+        if(err != AL_NO_ERROR)
+            al_throwerr(Context, err);
+    }
+    al_catchany()
+    {
+        if(cur > 0)
+            alDeleteAuxiliaryEffectSlots(cur, effectslots);
+    }
+    al_endtry;

     ALCcontext_DecRef(Context);
 }
@@ -100,48 +91,38 @@
 AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots)
 {
     ALCcontext *Context;
-    ALeffectslot *EffectSlot;
+    ALeffectslot *slot;
     ALsizei i;

     Context = GetContextRef();
     if(!Context) return;

-    if(n < 0)
-        alSetError(Context, AL_INVALID_VALUE);
-    else
-    {
-        // Check that all effectslots are valid
+    al_try
+    {
+        CHECK_VALUE(Context, n >= 0);
         for(i = 0;i < n;i++)
         {
-            if((EffectSlot=LookupEffectSlot(Context, effectslots[i])) == NULL)
-            {
-                alSetError(Context, AL_INVALID_NAME);
-                n = 0;
-                break;
-            }
-            else if(EffectSlot->ref != 0)
-            {
-                alSetError(Context, AL_INVALID_OPERATION);
-                n = 0;
-                break;
-            }
+            if((slot=LookupEffectSlot(Context, effectslots[i])) == NULL)
+                al_throwerr(Context, AL_INVALID_NAME);
+            if(slot->ref != 0)
+                al_throwerr(Context, AL_INVALID_OPERATION);
         }

         // All effectslots are valid
         for(i = 0;i < n;i++)
         {
-            // Recheck that the effectslot is valid, because there could be duplicated names
-            if((EffectSlot=RemoveEffectSlot(Context, effectslots[i])) == NULL)
+            if((slot=RemoveEffectSlot(Context, effectslots[i])) == NULL)
                 continue;
-            FreeThunkEntry(EffectSlot->id);
-
-            RemoveEffectSlotArray(Context, EffectSlot);
-            ALeffectState_Destroy(EffectSlot->EffectState);
-
-            memset(EffectSlot, 0, sizeof(ALeffectslot));
-            free(EffectSlot);
-        }
-    }
+            FreeThunkEntry(slot->id);
+
+            RemoveEffectSlotArray(Context, slot);
+            ALeffectState_Destroy(slot->EffectState);
+
+            memset(slot, 0, sizeof(*slot));
+            free(slot);
+        }
+    }
+    al_endtry;

     ALCcontext_DecRef(Context);
 }
@@ -163,51 +144,42 @@

 AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint value)
 {
-    ALCdevice *Device;
-    ALCcontext *Context;
-    ALeffectslot *EffectSlot;
-
-    Context = GetContextRef();
-    if(!Context) return;
-
-    Device = Context->Device;
-    if((EffectSlot=LookupEffectSlot(Context, effectslot)) != NULL)
-    {
-        switch(param)
-        {
-        case AL_EFFECTSLOT_EFFECT: {
-            ALeffect *effect = NULL;
-
-            if(value == 0 || (effect=LookupEffect(Device, value)) != NULL)
-            {
-                ALenum err;
-                err = InitializeEffect(Device, EffectSlot, effect);
-                if(err != AL_NO_ERROR)
-                    alSetError(Context, err);
-                else
-                    Context->UpdateSources = AL_TRUE;
-            }
-            else
-                alSetError(Context, AL_INVALID_VALUE);
-        }   break;
+    ALCcontext *Context;
+    ALeffectslot *Slot;
+    ALeffect *effect = NULL;
+    ALenum err;
+
+    Context = GetContextRef();
+    if(!Context) return;
+
+    al_try
+    {
+        ALCdevice *device = Context->Device;
+        if((Slot=LookupEffectSlot(Context, effectslot)) == NULL)
+            al_throwerr(Context, AL_INVALID_NAME);
+        switch(param)
+        {
+        case AL_EFFECTSLOT_EFFECT:
+            CHECK_VALUE(Context, value == 0 || (effect=LookupEffect(device, value)) != NULL);
+
+            err = InitializeEffect(device, Slot, effect);
+            if(err != AL_NO_ERROR)
+                al_throwerr(Context, err);
+            Context->UpdateSources = AL_TRUE;
+            break;

         case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
-            if(value == AL_TRUE || value == AL_FALSE)
-            {
-                EffectSlot->AuxSendAuto = value;
-                Context->UpdateSources = AL_TRUE;
-            }
-            else
-                alSetError(Context, AL_INVALID_VALUE);
+            CHECK_VALUE(Context, value == AL_TRUE || value == AL_FALSE);
+
+            Slot->AuxSendAuto = value;
+            Context->UpdateSources = AL_TRUE;
             break;

         default:
-            alSetError(Context, AL_INVALID_ENUM);
-            break;
-        }
-    }
-    else
-        alSetError(Context, AL_INVALID_NAME);
+            al_throwerr(Context, AL_INVALID_ENUM);
+        }
+    }
+    al_endtry;

     ALCcontext_DecRef(Context);
 }
@@ -227,50 +199,47 @@
     Context = GetContextRef();
     if(!Context) return;

-    if(LookupEffectSlot(Context, effectslot) != NULL)
-    {
-        switch(param)
-        {
-        default:
-            alSetError(Context, AL_INVALID_ENUM);
+    al_try
+    {
+        if(LookupEffectSlot(Context, effectslot) == NULL)
+            al_throwerr(Context, AL_INVALID_NAME);
+        switch(param)
+        {
+        default:
+            al_throwerr(Context, AL_INVALID_ENUM);
+        }
+    }
+    al_endtry;
+
+    ALCcontext_DecRef(Context);
+}
+
+AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat value)
+{
+    ALCcontext *Context;
+    ALeffectslot *Slot;
+
+    Context = GetContextRef();
+    if(!Context) return;
+
+    al_try
+    {
+        if((Slot=LookupEffectSlot(Context, effectslot)) == NULL)
+            al_throwerr(Context, AL_INVALID_NAME);
+        switch(param)
+        {
+        case AL_EFFECTSLOT_GAIN:
+            CHECK_VALUE(Context, value >= 0.0f && value <= 1.0f);
+
+            Slot->Gain = value;
+            Slot->NeedsUpdate = AL_TRUE;
             break;
-        }
-    }
-    else
-        alSetError(Context, AL_INVALID_NAME);
-
-    ALCcontext_DecRef(Context);
-}
-
-AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat value)
-{
-    ALCcontext *Context;
-    ALeffectslot *EffectSlot;
-
-    Context = GetContextRef();
-    if(!Context) return;
-
-    if((EffectSlot=LookupEffectSlot(Context, effectslot)) != NULL)
-    {
-        switch(param)
-        {
-        case AL_EFFECTSLOT_GAIN:
-            if(value >= 0.0f && value <= 1.0f)
-            {
-                EffectSlot->Gain = value;
-                EffectSlot->NeedsUpdate = AL_TRUE;
-            }
-            else
-                alSetError(Context, AL_INVALID_VALUE);
-            break;
-
-        default:
-            alSetError(Context, AL_INVALID_ENUM);
-            break;
-        }
-    }
-    else
-        alSetError(Context, AL_INVALID_NAME);
+
+        default:
+            al_throwerr(Context, AL_INVALID_ENUM);
+        }
+    }
+    al_endtry;

     ALCcontext_DecRef(Context);
 }
@@ -289,48 +258,48 @@
     Context = GetContextRef();
     if(!Context) return;

-    if(LookupEffectSlot(Context, effectslot) != NULL)
-    {
-        switch(param)
-        {
-        default:
-            alSetError(Context, AL_INVALID_ENUM);
+    al_try
+    {
+        if(LookupEffectSlot(Context, effectslot) == NULL)
+            al_throwerr(Context, AL_INVALID_NAME);
+        switch(param)
+        {
+        default:
+            al_throwerr(Context, AL_INVALID_ENUM);
+        }
+    }
+    al_endtry;
+
+    ALCcontext_DecRef(Context);
+}
+
+AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *value)
+{
+    ALCcontext *Context;
+    ALeffectslot *Slot;
+
+    Context = GetContextRef();
+    if(!Context) return;
+
+    al_try
+    {
+        if((Slot=LookupEffectSlot(Context, effectslot)) == NULL)
+            al_throwerr(Context, AL_INVALID_NAME);
+        switch(param)
+        {
+        case AL_EFFECTSLOT_EFFECT:
+            *value = Slot->effect.id;
             break;
-        }
-    }
-    else
-        alSetError(Context, AL_INVALID_NAME);
-
-    ALCcontext_DecRef(Context);
-}
-
-AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *value)
-{
-    ALCcontext *Context;
-    ALeffectslot *EffectSlot;
-
-    Context = GetContextRef();
-    if(!Context) return;
-
-    if((EffectSlot=LookupEffectSlot(Context, effectslot)) != NULL)
-    {
-        switch(param)
-        {
-        case AL_EFFECTSLOT_EFFECT:
-            *value = EffectSlot->effect.id;
+
+        case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
+            *value = Slot->AuxSendAuto;
             break;

-        case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
-            *value = EffectSlot->AuxSendAuto;
-            break;
-
-        default:
-            alSetError(Context, AL_INVALID_ENUM);
-            break;
-        }
-    }
-    else
-        alSetError(Context, AL_INVALID_NAME);
+        default:
+            al_throwerr(Context, AL_INVALID_ENUM);
+        }
+    }
+    al_endtry;

     ALCcontext_DecRef(Context);
 }
@@ -350,44 +319,44 @@
     Context = GetContextRef();
     if(!Context) return;

-    if(LookupEffectSlot(Context, effectslot) != NULL)
-    {
-        switch(param)
-        {
-        default:
-            alSetError(Context, AL_INVALID_ENUM);
+    al_try
+    {
+        if(LookupEffectSlot(Context, effectslot) == NULL)
+            al_throwerr(Context, AL_INVALID_NAME);
+        switch(param)
+        {
+        default:
+            al_throwerr(Context, AL_INVALID_ENUM);
+        }
+    }
+    al_endtry;
+
+    ALCcontext_DecRef(Context);
+}
+
+AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *value)
+{
+    ALCcontext *Context;
+    ALeffectslot *Slot;
+
+    Context = GetContextRef();
+    if(!Context) return;
+
+    al_try
+    {
+        if((Slot=LookupEffectSlot(Context, effectslot)) == NULL)
+            al_throwerr(Context, AL_INVALID_NAME);
+        switch(param)
+        {
+        case AL_EFFECTSLOT_GAIN:
+            *value = Slot->Gain;
             break;
-        }
-    }
-    else
-        alSetError(Context, AL_INVALID_NAME);
-
-    ALCcontext_DecRef(Context);
-}
-
-AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *value)
-{
-    ALCcontext *Context;
-    ALeffectslot *EffectSlot;
-
-    Context = GetContextRef();
-    if(!Context) return;
-
-    if((EffectSlot=LookupEffectSlot(Context, effectslot)) != NULL)
-    {
-        switch(param)
-        {
-        case AL_EFFECTSLOT_GAIN:
-            *value = EffectSlot->Gain;
-            break;
-
-        default:
-            alSetError(Context, AL_INVALID_ENUM);
-            break;
-        }
-    }
-    else
-        alSetError(Context, AL_INVALID_NAME);
+
+        default:
+            al_throwerr(Context, AL_INVALID_ENUM);
+        }
+    }
+    al_endtry;

     ALCcontext_DecRef(Context);
 }
@@ -406,17 +375,17 @@
     Context = GetContextRef();
     if(!Context) return;

-    if(LookupEffectSlot(Context, effectslot) != NULL)
-    {
-        switch(param)
-        {
-        default:
-            alSetError(Context, AL_INVALID_ENUM);
-            break;
-        }
-    }
-    else
-        alSetError(Context, AL_INVALID_NAME);
+    al_try
+    {
+        if(LookupEffectSlot(Context, effectslot) == NULL)
+            al_throwerr(Context, AL_INVALID_NAME);
+        switch(param)
+        {
+        default:
+            al_throwerr(Context, AL_INVALID_ENUM);
+        }
+    }
+    al_endtry;

     ALCcontext_DecRef(Context);
 }
@@ -480,23 +449,35 @@
     UnlockContext(Context);
 }

-static ALenum ResizeEffectSlotArray(ALCcontext *Context, ALsizei count)
-{
-    ALsizei newcount;
-    void *temp;
-
-    if(count <= Context->MaxActiveEffectSlots-Context->ActiveEffectSlotCount)
-        return AL_NO_ERROR;
-
-    newcount = Context->MaxActiveEffectSlots ?
-               (Context->MaxActiveEffectSlots<<1) : 1;
-    if(newcount <= Context->MaxActiveEffectSlots ||
-       !(temp=realloc(Context->ActiveEffectSlots, newcount *
-                                                  sizeof(*Context->ActiveEffectSlots))))
-        return AL_OUT_OF_MEMORY;
-
-    Context->ActiveEffectSlots = temp;
-    Context->MaxActiveEffectSlots = newcount;
+static ALenum AddEffectSlotArray(ALCcontext *Context, ALsizei count, const ALuint *slots)
+{
+    ALsizei i;
+
+    LockContext(Context);
+    if(count > Context->MaxActiveEffectSlots-Context->ActiveEffectSlotCount)
+    {
+        ALsizei newcount;
+        void *temp = NULL;
+
+        newcount = Context->MaxActiveEffectSlots ? (Context->MaxActiveEffectSlots<<1) : 1;
+        if(newcount > Context->MaxActiveEffectSlots)
+            temp = realloc(Context->ActiveEffectSlots,
+                           newcount * sizeof(*Context->ActiveEffectSlots));
+        if(!temp)
+        {
+            UnlockContext(Context);
+            return AL_OUT_OF_MEMORY;
+        }
+        Context->ActiveEffectSlots = temp;
+        Context->MaxActiveEffectSlots = newcount;
+    }
+    for(i = 0;i < count;i++)
+    {
+        ALeffectslot *slot = LookupEffectSlot(Context, slots[i]);
+        assert(slot != NULL);
+        Context->ActiveEffectSlots[Context->ActiveEffectSlotCount++] = slot;
+    }
+    UnlockContext(Context);
     return AL_NO_ERROR;
 }

@@ -619,7 +600,6 @@
         ALeffectslot *temp = Context->EffectSlotMap.array[pos].value;
         Context->EffectSlotMap.array[pos].value = NULL;

-        // Release effectslot structure
         ALeffectState_Destroy(temp->EffectState);

         FreeThunkEntry(temp->id);


mplex_current_node falls back to mx_current.

(Kludge to get around problems with deferred destroy and groups.)

darcs-hash:20061018180442-4eba8-7bc7af9d71450cb9bf5138c5a28e6f93a33c69bf.gz

--- ioncore/mplex.c
+++ ioncore/mplex.c
@@ -198,12 +198,18 @@

 WStacking *mplex_current_node(WMPlex *mplex)
 {
+    WStacking *st=NULL;
     WRegion *reg;

     reg=REGION_ACTIVE_SUB(mplex);
     reg=region_managed_within((WRegion*)mplex, reg);
-
-    return (reg==NULL ? NULL : mplex_find_stacking(mplex, reg));
+    if(reg!=NULL)
+        st=mplex_find_stacking(mplex, reg);
+
+    if(st!=NULL)
+        return st;
+    else
+        return (mplex->mx_current!=NULL ? mplex->mx_current->st : NULL);
 }


Added Timeline::apply()/appendTo() variants that take an Anim and a start value

--- include/cinder/Timeline.h
+++ include/cinder/Timeline.h
@@ -62,12 +62,28 @@
 		return applyPtr( target->ptr(), endValue, duration, easeFunction, lerpFunction );
 	}

+	//! Replaces any existing tweens on the \a target with a new tween at the timeline's current time
+	template<typename T>
+	typename Tween<T>::Options apply( Anim<T> *target, T startValue, T endValue, float duration, EaseFn easeFunction = easeNone, typename Tween<T>::LerpFn lerpFunction = &tweenLerp<T> )
+	{
+		target->setParentTimeline( thisRef() );
+		return applyPtr( target->ptr(), startValue, endValue, duration, easeFunction, lerpFunction );
+	}
+
 	//! Creates a new tween and adds it to the end of the last tween on \a target, or if no existing tween matches the target, the current time.
 	template<typename T>
 	typename Tween<T>::Options appendTo( Anim<T> *target, T endValue, float duration, EaseFn easeFunction = easeNone, typename Tween<T>::LerpFn lerpFunction = &tweenLerp<T> )
 	{
 		target->setParentTimeline( thisRef() );
 		return appendToPtr( target->ptr(), endValue, duration, easeFunction, lerpFunction );
+	}
+
+	//! Creates a new tween and adds it to the end of the last tween on \a target, or if no existing tween matches the target, the current time.
+	template<typename T>
+	typename Tween<T>::Options appendTo( Anim<T> *target, T startValue, T endValue, float duration, EaseFn easeFunction = easeNone, typename Tween<T>::LerpFn lerpFunction = &tweenLerp<T> )
+	{
+		target->setParentTimeline( thisRef() );
+		return appendToPtr( target->ptr(), startValue, endValue, duration, easeFunction, lerpFunction );
 	}

 	//! Replaces any existing tweens on the \a target with a new tween at the timeline's current time. Consider the apply( Anim<T>* ) variant unless you have an advanced use case.


Require 64KB uniform buffers;

Require 64KB uniform buffers;

64KB is near-ubiquitous, and the per-draw UBO needs this much space.

--- src/modules/graphics/graphics.c
+++ src/modules/graphics/graphics.c
@@ -414,6 +414,8 @@
   if (!gpu_init(&config)) {
     lovrThrow("Failed to initialize GPU");
   }
+
+  lovrAssert(state.limits.uniformBufferRange >= 65536, "LÖVR requires the GPU to support a uniform buffer range of at least 64KB");

   // Temporary frame memory uses a large 1GB virtual memory allocation, committing pages as needed
   state.allocator.length = 1 << 14;


Use more meaningful name

Use more meaningful name

--- lib/proc/proc_select.c
+++ lib/proc/proc_select.c
@@ -447,9 +447,9 @@
 }

 typedef enum {
-  NONE = 0,
-  JUST,
-  VISITED
+  TSORT_STATUS_NOT_VISITED,
+  TSORT_STATUS_VISITING,
+  TSORT_STATUS_VISITED
 } tsort_status;

 static grn_bool
@@ -459,12 +459,12 @@
                      grn_id to, grn_obj *ids)
 {
   switch (visits[to - 1]) {
-  case JUST:
+  case TSORT_STATUS_VISITING:
     return GRN_TRUE;
-  case VISITED:
+  case TSORT_STATUS_VISITED:
     return GRN_FALSE;
-  default:
-    visits[to - 1] = JUST;
+  case TSORT_STATUS_NOT_VISITED:
+    visits[to - 1] = TSORT_STATUS_VISITING;
     {
       drilldown_info *drilldown = &(drilldowns[to - 1]);
       if (drilldown->table_name) {
@@ -478,7 +478,7 @@
         }
       }
     }
-    visits[to - 1] = VISITED;
+    visits[to - 1] = TSORT_STATUS_VISITED;
     grn_uvector_add_element(ctx, ids, to - 1, 0);
     return GRN_FALSE;
   }
@@ -517,7 +517,7 @@
     grn_id id;
     id = grn_table_add(ctx, labels, drilldown->label, drilldown->label_len, &added);
     if (added) {
-      visits[id - 1] = NONE;
+      visits[id - 1] = TSORT_STATUS_NOT_VISITED;
     }
   }
 }


Removed unnecessary code

Removed unnecessary code

--- src/standard_properties.h
+++ src/standard_properties.h
@@ -3,9 +3,7 @@
 #define USER_PROPERTIES_H_

 #include "base_types.h"
-#include "Error.h"
-
-#include <linux/videodev2.h>
+
 #include <string>
 #include <vector>
 #include <cstring>
@@ -296,10 +294,6 @@
 inline tcam_camera_property create_empty_property (enum TCAM_PROPERTY_ID id)
 {
     auto ref = get_control_reference(id);
-    if (ref.id == INVALID_STD_PROPERTY.id)
-    {
-        setError(Error("No matching property", ENOENT));
-    }

     tcam_camera_property prop = {};
     prop.type = ref.type_to_use;


Improve coding pattern in Parallel Append code.

The create_append_path code didn't consider that list_concat will
modify it's first argument leading to inconsistent traversal of
resulting list.  In practice, it won't lead to any user-visible bug
but changing it for making the code behave consistently.

Reported-by: Tom Lane
Author: Tom Lane
Reviewed-by: Amit Khandekar and Amit Kapila
Discussion: 1a6696055f4e9efacbd937efe8121e9d117a1bb0@sss.pgh.pa.us

--- src/backend/optimizer/util/pathnode.c
+++ src/backend/optimizer/util/pathnode.c
@@ -1274,7 +1274,7 @@
 	pathnode->first_partial_path = list_length(subpaths);
 	pathnode->subpaths = list_concat(subpaths, partial_subpaths);

-	foreach(l, subpaths)
+	foreach(l, pathnode->subpaths)
 	{
 		Path	   *subpath = (Path *) lfirst(l);


fix string initializer emitting 1 char too much

[r17679]

--- ir/be/begnuas.c
+++ ir/be/begnuas.c
@@ -554,7 +554,7 @@
 	obstack_printf(obst, "\t.string \"");

 	len = initializer->compound.n_initializers;
-	for(i = 0; i < len; ++i) {
+	for(i = 0; i < len - 1; ++i) {
 		const ir_initializer_t *sub_initializer
 			= get_initializer_compound_value(initializer, i);


Fixed a nasty bug in the way DECLARE_IBASE_EXT() was used.  It was passed
csSector as the parent class which resulted in method implementations which
looped infinitely, such as "csSector::IncRef() { csSector::IncRef(); }".
Now properly passes in csPolygonSet as the parent class.

git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@3570 8cc4aa7f-3514-0410-904f-f2cc9021211c

--- include/csengine/sector.h
+++ include/csengine/sector.h
@@ -362,7 +362,7 @@
   void ShineLights (csThing*, csProgressPulse* = 0);

   CSOBJTYPE;
-  DECLARE_IBASE_EXT (csSector);
+  DECLARE_IBASE_EXT (csPolygonSet);

   //------------------------- iSector interface -------------------------------
   struct SectorInterface : public iSector


Remove declarations without functions.

Remove declarations without functions.

--- src/modules/ibox/e_mod_config.c
+++ src/modules/ibox/e_mod_config.c
@@ -22,9 +22,6 @@
 static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
 static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
 static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
-
-static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
-static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);

 static void _cb_zone_policy_change(void *data, Evas_Object *obj);


Add missing #include

Add missing #include

git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@33718 8cc4aa7f-3514-0410-904f-f2cc9021211c

--- include/csutil/refcount.h
+++ include/csutil/refcount.h
@@ -25,6 +25,7 @@
  */

 #include "csextern.h"
+#include "csutil/threading/atomicops.h"
 #include "csutil/reftrackeraccess.h"

 /**


Partially revert my patch of 2008-11-12 that installed a limit on the number
of AND/OR clause branches that predtest.c would attempt to deal with.  As
noted in bug #4721, that change disabled proof attempts for sizes of problems
that people are actually expecting it to work for.  The original complaint
it was trying to solve was O(N^2) behavior for long IN-lists, so let's try
applying the limit to just ScalarArrayOpExprs rather than everything.
Another case of "foolish consistency" I fear.

Back-patch to 8.2, same as the previous patch was.

--- src/backend/optimizer/util/predtest.c
+++ src/backend/optimizer/util/predtest.c
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *	  $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.19.2.1 2008/11/12 23:08:42 tgl Exp $
+ *	  $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.19.2.2 2009/05/11 17:56:14 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -29,13 +29,13 @@

 /*
- * Proof attempts involving many AND or OR branches are likely to require
- * O(N^2) time, and more often than not fail anyway.  So we set an arbitrary
- * limit on the number of branches that we will allow at any one level of
- * clause.  (Note that this is only effective because the trees have been
- * AND/OR flattened!)  XXX is it worth exposing this as a GUC knob?
- */
-#define MAX_BRANCHES_TO_TEST	100
+ * Proof attempts involving large arrays in ScalarArrayOpExpr nodes are
+ * likely to require O(N^2) time, and more often than not fail anyway.
+ * So we set an arbitrary limit on the number of array elements that
+ * we will allow to be treated as an AND or OR clause.
+ * XXX is it worth exposing this as a GUC knob?
+ */
+#define MAX_SAOP_ARRAY_SIZE		100

 /*
  * To avoid redundant coding in predicate_implied_by_recurse and
@@ -697,12 +697,12 @@
  * If the expression is classified as AND- or OR-type, then *info is filled
  * in with the functions needed to iterate over its components.
  *
- * This function also implements enforcement of MAX_BRANCHES_TO_TEST: if an
- * AND/OR expression has too many branches, we just classify it as an atom.
- * (This will result in its being passed as-is to the simple_clause functions,
- * which will fail to prove anything about it.)  Note that we cannot just stop
- * after considering MAX_BRANCHES_TO_TEST branches; in general that would
- * result in wrong proofs rather than failing to prove anything.
+ * This function also implements enforcement of MAX_SAOP_ARRAY_SIZE: if a
+ * ScalarArrayOpExpr's array has too many elements, we just classify it as an
+ * atom.  (This will result in its being passed as-is to the simple_clause
+ * functions, which will fail to prove anything about it.)  Note that we
+ * cannot just stop after considering MAX_SAOP_ARRAY_SIZE elements; in general
+ * that would result in wrong proofs, rather than failing to prove anything.
  */
 static PredClass
 predicate_classify(Node *clause, PredIterInfo info)
@@ -715,8 +715,7 @@
 	 * If we see a List, assume it's an implicit-AND list; this is the correct
 	 * semantics for lists of RestrictInfo nodes.
 	 */
-	if (IsA(clause, List) &&
-		list_length((List *) clause) <= MAX_BRANCHES_TO_TEST)
+	if (IsA(clause, List))
 	{
 		info->startup_fn = list_startup_fn;
 		info->next_fn = list_next_fn;
@@ -725,16 +724,14 @@
 	}

 	/* Handle normal AND and OR boolean clauses */
-	if (and_clause(clause) &&
-		list_length(((BoolExpr *) clause)->args) <= MAX_BRANCHES_TO_TEST)
+	if (and_clause(clause))
 	{
 		info->startup_fn = boolexpr_startup_fn;
 		info->next_fn = list_next_fn;
 		info->cleanup_fn = list_cleanup_fn;
 		return CLASS_AND;
 	}
-	if (or_clause(clause) &&
-		list_length(((BoolExpr *) clause)->args) <= MAX_BRANCHES_TO_TEST)
+	if (or_clause(clause))
 	{
 		info->startup_fn = boolexpr_startup_fn;
 		info->next_fn = list_next_fn;
@@ -762,7 +759,7 @@

 			arrayval = DatumGetArrayTypeP(((Const *) arraynode)->constvalue);
 			nelems = ArrayGetNItems(ARR_NDIM(arrayval), ARR_DIMS(arrayval));
-			if (nelems <= MAX_BRANCHES_TO_TEST)
+			if (nelems <= MAX_SAOP_ARRAY_SIZE)
 			{
 				info->startup_fn = arrayconst_startup_fn;
 				info->next_fn = arrayconst_next_fn;
@@ -772,7 +769,7 @@
 		}
 		else if (arraynode && IsA(arraynode, ArrayExpr) &&
 				 !((ArrayExpr *) arraynode)->multidims &&
-				 list_length(((ArrayExpr *) arraynode)->elements) <= MAX_BRANCHES_TO_TEST)
+				 list_length(((ArrayExpr *) arraynode)->elements) <= MAX_SAOP_ARRAY_SIZE)
 		{
 			info->startup_fn = arrayexpr_startup_fn;
 			info->next_fn = arrayexpr_next_fn;


fixed bug

fixed bug

--- ir/be/belower.c
+++ ir/be/belower.c
@@ -496,7 +496,7 @@

 static void gen_assure_different_pattern(ir_node *irn, be_irg_t *birg, ir_node *other_different) {
 	const arch_env_t          *arch_env = birg->main_env->arch_env;
-	ir_node                   *in[1], *keep, *cpy, *temp;
+	ir_node                   *in[2], *keep, *cpy, *temp;
 	ir_node                   *block = get_nodes_block(irn);
 	firm_dbg_module_t         *mod   = firm_dbg_register("firm.be.lower");
 	const arch_register_class_t *cls = arch_get_irn_reg_class(arch_env, other_different, -1);


select: run ID resolve code only when it's needed

--- lib/proc/proc_select.c
+++ lib/proc/proc_select.c
@@ -487,13 +487,14 @@

       GRN_RECORD_SET(ctx, record, id);
       value = grn_expr_exec(ctx, expression, 0);
-      if (column_data->sortby.length > 0) {
-        void *buf;
-        grn_table_cursor_get_value(ctx, table_cursor, &buf);
-        id = *((grn_id *)buf);
-      }
       if (value) {
-        grn_obj_set_value(ctx, column, id, value, GRN_OBJ_SET);
+        grn_id target_record_id = id;
+        if (column_data->sortby.length > 0) {
+          void *sorted_table_value;
+          grn_table_cursor_get_value(ctx, table_cursor, &sorted_table_value);
+          target_record_id = *((grn_id *)sorted_table_value);
+        }
+        grn_obj_set_value(ctx, column, target_record_id, value, GRN_OBJ_SET);
       }
     }


whitespace

whitespace

--- src/modules/navigator/mission.h
+++ src/modules/navigator/mission.h
@@ -78,7 +78,7 @@

 	enum mission_altitude_mode {
 		MISSION_ALTMODE_ZOH = 0,
-		MISSION_ALTMODE_FOH =1
+		MISSION_ALTMODE_FOH = 1
 	};

 private:


Removed typed += & -= operators and replaced with templates.

--- include/etl/debug_count.h
+++ include/etl/debug_count.h
@@ -84,25 +84,15 @@
       return *this;
     }

-    inline debug_count& operator +=(int32_t n)
-    {
-      count += n;
-      return *this;
-    }
-
-    inline debug_count& operator -=(int32_t n)
-    {
-      count -= n;
-      return *this;
-    }
-
-    inline debug_count& operator +=(size_t n)
+    template <typename T>
+    inline debug_count& operator +=(T n)
     {
       count += int32_t(n);
       return *this;
     }

-    inline debug_count& operator -=(size_t n)
+    template <typename T>
+    inline debug_count& operator -=(T n)
     {
       count -= int32_t(n);
       return *this;


belower: if use_copies is set, also convert transpositions to copies

If use_copies is set (i.e. if we prefer copies over exchanges) and a free
register is available, we want to lower transpositions to sets of three
copies.

This improves performance on x86, since mov is essentially free but xchg
takes 3 uops.

--- ir/be/belower.c
+++ ir/be/belower.c
@@ -215,9 +215,8 @@
 		}
 	}

-	if (arity == 2 && !rbitset_is_empty(inregs, n_regs)) {
-		DBG((dbg, LEVEL_1, "%+F is transposition\n", perm));
-		return;
+	if (rbitset_is_empty(inregs, n_regs)) {
+		goto done;
 	}

 	if (use_copies && free_reg == NULL) {
@@ -249,6 +248,11 @@
 			exchange(start->out_node, restore_copy);
 		}
 	} else {
+		if (arity == 2) {
+			DBG((dbg, LEVEL_1, "%+F is transposition\n", perm));
+			return;
+		}
+
 		/* Decompose cycles into transpositions.
 		 *
 		 * Use as many independent transpositions as possible and do not thread


wl-drm: Fix issue of not being able to set output mode

If we pass in screen geometry here when trying to set an output mode,
we can encounter "out of memory" errors from libdrm with outputs that
have a high resolution. As it turns out, we should be passing 0, 0 for
the x/y values when trying to set an output mode.

@fix

Signed-off-by: Chris Michael <177aeddb9e34930a357ecd8dd2d21c80fe280c85@samsung.com>

--- src/modules/wl_drm/e_mod_main.c
+++ src/modules/wl_drm/e_mod_main.c
@@ -580,8 +580,7 @@
         if (s->config.priority > top_priority)
           top_priority = s->config.priority;

-        ecore_drm2_output_mode_set(output, mode, s->config.geom.x,
-                                   s->config.geom.y);
+        ecore_drm2_output_mode_set(output, mode, 0, 0);

         /* TODO: cannot support rotations until we support planes
          * and we cannot support planes until Atomic support is in */


Removed unused variable.

Removed unused variable.

The get_n in the foreach loop is a macro and not a use of the function.

--- ir/ir/iredges.c
+++ ir/ir/iredges.c
@@ -519,9 +519,7 @@
 	int                   i, n;
 	ir_edge_kind_t        kind = w->kind;
 	ir_graph              *irg = get_irn_irg(irn);
-	get_edge_src_n_func_t *get_n;
-
-	get_n = edge_kind_info[kind].get_n;
+
 	foreach_tgt(irn, i, n, kind) {
 		ir_node *pred = get_n(irn, i, kind);
 		edges_notify_edge_kind(irn, i, pred, NULL, kind, irg);


Added conjunction and disjunction

Added conjunction and disjunction

--- include/etl/type_traits.h
+++ include/etl/type_traits.h
@@ -492,6 +492,11 @@
   template <bool B, typename T, typename F>  struct conditional { typedef T type; };
   template <typename T, typename F> struct conditional<false, T, F> { typedef F type; };

+#if ETL_CPP11_SUPPORTED
+  template <bool B, typename T, typename F>
+  using conditional_t = typename conditional<B, T, F>::type;
+#endif
+
   //***************************************************************************
   /// make_signed
   template <typename T> struct make_signed { typedef  T type; };
@@ -1211,6 +1216,11 @@
   template <bool B, typename T, typename F>  struct conditional { typedef T type; };
   template <typename T, typename F> struct conditional<false, T, F> { typedef F type; };

+#if ETL_CPP11_SUPPORTED
+  template <bool B, typename T, typename F>
+  using conditional_t = typename conditional<B, T, F>::type;
+#endif
+
   //***************************************************************************
   /// make_signed
   ///\ingroup type_traits
@@ -1356,6 +1366,7 @@
   ///\ingroup type_traits
   template <typename T> struct alignment_of : std::alignment_of<T> {};
   template <> struct alignment_of<void> : std::integral_constant<size_t, 0> {};
+  template <> struct alignment_of<const void> : integral_constant <size_t, 0> {};

 #if ETL_CPP17_SUPPORTED
   template <typename T>
@@ -1612,6 +1623,53 @@
   template <typename T, typename T1, typename... TRest>
   inline constexpr bool are_all_same_v = are_all_same<T, T1, TRest...>::value;
 #endif
+
+  //***************************************************************************
+  /// conjunction
+#if ETL_CPP11_SUPPORTED
+  template <typename...>
+  struct conjunction : public etl::true_type
+  {
+  };
+
+  template <typename T1, typename... Tn>
+  struct conjunction<T1, Tn...> : public etl::conditional_t<bool(T1::value), etl::conjunction<Tn...>, T1>
+  {
+  };
+
+  template <typename T>
+  struct conjunction<T> : public T
+  {
+  };
+#endif
+
+#if ETL_CPP17_SUPPORTED
+  template <typename... T>
+  inline constexpr bool conjunction_v = conjunction<T...>::value;
+#endif
+
+  //***************************************************************************
+  /// disjunction
+#if ETL_CPP11_SUPPORTED
+  template <typename...>
+  struct disjunction : public etl::false_type
+  {
+  };
+
+  template <typename T1, typename... Tn>
+  struct disjunction<T1, Tn...> : public etl::conditional_t<bool(T1::value), T1, disjunction<Tn...>>
+  {
+  };
+
+  template <typename T1> struct disjunction<T1> : public T1
+  {
+  };
+#endif
+
+#if ETL_CPP17_SUPPORTED
+  template <typename... T>
+  inline constexpr bool disjunction_v = etl::disjunction<T...>::value;
+#endif
 }

 #endif // ETL_TYPE_TRAITS_INCLUDED


make keymap match what drm uses by default

NB: this is all in the process of getting fixed...

Signed-off-by: Chris Michael <177aeddb9e34930a357ecd8dd2d21c80fe280c85@samsung.com>

--- src/modules/wl_drm/e_mod_main.c
+++ src/modules/wl_drm/e_mod_main.c
@@ -1,7 +1,7 @@
 #include "e.h"
 #include "e_comp_wl.h"
-#include <Ecore_Drm.h>
-//#include <Ecore_Wayland.h>
+#include "e_comp_wl_input.h"
+/* #include <Ecore_Drm.h> */

 #define SCREEN_WIDTH 1920
 #define SCREEN_HEIGHT 1200
@@ -56,8 +56,22 @@
    e_comp_wl_input_pointer_enabled_set(comp->comp_data, EINA_TRUE);
    e_comp_wl_input_keyboard_enabled_set(comp->comp_data, EINA_TRUE);

+   /* comp->pointer =  */
+   /*   e_pointer_window_new(ecore_evas_window_get(comp->ee), 1); */
    comp->pointer = e_pointer_canvas_new(comp->evas, 1);
    comp->pointer->color = 1;
+
+   /* FIXME: We need a way to trap for user changing the keymap inside of E
+    *        without the event coming from X11 */
+
+   /* FIXME: We should make a decision here ...
+    *
+    * Fetch the keymap from drm, OR set this to what the E config is....
+    */
+
+   /* FIXME: This is just for testing at the moment....
+    * happens to jive with what drm does */
+   e_comp_wl_input_keymap_set(comp->comp_data, NULL, NULL, NULL);

    return m;
 }


added hook for real function call processing

[r5383]

--- ir/ir/irhooks.h
+++ ir/ir/irhooks.h
@@ -46,6 +46,7 @@
   HOOK_OPT_REASSOC,     /**< reassociation */
   HOOK_OPT_POLY_CALL,   /**< polymorphic call optimization */
   HOOK_OPT_IF_CONV,     /**< an if conversion was tried */
+  HOOK_OPT_FUNC_CALL,   /**< a real function call was removed */
   HOOK_LOWERED,         /**< lowered */
   HOOK_OPT_LAST
 } hook_opt_kind;
@@ -87,6 +88,7 @@
     void (*_hook_dead_node_elim_start)(void *context, ir_graph *irg);
     void (*_hook_dead_node_elim_stop)(void *context, ir_graph *irg);
     void (*_hook_if_conversion)(void *context, ir_graph *irg, ir_node *phi, int pos, ir_node *mux, if_result_t reason);
+    void (*_hook_func_call)(void *context, ir_graph *irg, ir_node *call);
     void (*_hook_arch_dep_replace_mul_with_shifts)(void *context, ir_node *irn);
     void (*_hook_arch_dep_replace_div_by_const)(void *context, ir_node *irn);
     void (*_hook_arch_dep_replace_mod_by_const)(void *context, ir_node *irn);
@@ -124,6 +126,7 @@
   hook_dead_node_elim_start,
   hook_dead_node_elim_stop,
   hook_if_conversion,
+  hook_func_call,
   hook_arch_dep_replace_mul_with_shifts,
   hook_arch_dep_replace_div_by_const,
   hook_arch_dep_replace_mod_by_const,
@@ -187,6 +190,8 @@
 #define hook_dead_node_elim_stop(irg)     hook_exec(hook_dead_node_elim_stop, (ctx, irg))
 #define hook_if_conversion(irg, phi, pos, mux, reason) \
   hook_exec(hook_if_conversion, (ctx, irg, phi, pos, mux, reason))
+#define hook_func_call(irg, call) \
+  hook_exec(hook_func_call, (ctx, irg, call))
 #define hook_arch_dep_replace_mul_with_shifts(irn) \
   hook_exec(hook_arch_dep_replace_mul_with_shifts, (ctx, irn))
 #define hook_arch_dep_replace_div_by_const(irn) \


Fixes in multithreading and javascript/DOM Events

git-svn-id: ab66a9de07fa9d47c5829c82992f5279466c775f@2308 63c20433-aa62-49bd-875c-5a186b69a8fb

--- include/gpac/scenegraph.h
+++ include/gpac/scenegraph.h
@@ -302,8 +302,8 @@
 */
 void gf_node_dirty_clear(GF_Node *node, u32 flags);

-/*if the node is in a dirty state, resets it and the state of all its children*/
-void gf_node_dirty_reset(GF_Node *node);
+/*if the node is in a dirty state, resets it and the state of all its children if desired*/
+void gf_node_dirty_reset(GF_Node *node, Bool reset_children);

 /*get dirty flag value*/
 u32 gf_node_dirty_get(GF_Node *node);


config.h added

config.h added

[r5246]

--- ir/opt/ifconv.c
+++ ir/opt/ifconv.c
@@ -5,10 +5,22 @@
  * @date 4.2.2005
  * $Id$
  */
-
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_ALLOCA_H
 #include <alloca.h>
+#endif
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif

 #include "irgraph_t.h"
 #include "irnode_t.h"


Removed obsolete comment.

Removed obsolete comment.

git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@13588 8cc4aa7f-3514-0410-904f-f2cc9021211c


real: add top-level header

real: add top-level header

Signed-off-by: Helge Bahmann <c5618920f622561f9c0ec5c42219c4c08180149f@chaoticmind.net>

error: pathspec 'include/jive/types/real.h' did not match any file(s) known to git

--- include/jive/types/real.h
+++ include/jive/types/real.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright 2013 Nico Reißmann <nico.reissmann@gmail.com>
+ * See COPYING for terms of redistribution.
+ */
+
+#ifndef JIVE_TYPES_REAL_H
+#define JIVE_TYPES_REAL_H
+
+#include <jive/types/real/arithmetic.h>
+#include <jive/types/real/comparison.h>
+#include <jive/types/real/rlconstant.h>
+#include <jive/types/real/rloperation-classes.h>
+#include <jive/types/real/rltype.h>
+
+#endif


vsdg: gate inputs of graph tail node

vsdg: gate inputs of graph tail node

The export function just added bluntly inputs to the tail node. We
cannot do this any longer if we want to remove inputs and outputs,
since the graph tail node has officially no arguments. This entire
mess is going to be solved once we got rid off head and tail nodes.

Signed-off-by: Helge Bahmann <c5618920f622561f9c0ec5c42219c4c08180149f@chaoticmind.net>

--- include/jive/vsdg/graph.h
+++ include/jive/vsdg/graph.h
@@ -1,6 +1,6 @@
 /*
  * Copyright 2010 2011 2012 2013 2014 Helge Bahmann <hcb@chaoticmind.net>
- * Copyright 2011 2012 2013 2014 Nico Reißmann <nico.reissmann@gmail.com>
+ * Copyright 2011 2012 2013 2014 2015 Nico Reißmann <nico.reissmann@gmail.com>
  * See COPYING for terms of redistribution.
  */

@@ -124,7 +124,9 @@
 JIVE_EXPORTED_INLINE void
 jive_graph_export(struct jive_graph * self, jive::output * operand)
 {
-	jive_node_add_input(self->root_region->bottom, &operand->type(), operand);
+	//FIXME: change the signature to take the name for export
+	jive::gate * gate = operand->type().create_gate(self, "dummy");
+	jive_node_gate_input(self->root_region->bottom, gate, operand);
 }

 jive_graph *


More maths. I have no idea if this approach is sane, btw. More importantly, I've no useful ideas as to how to represent content:

svn path=/trunk/libcss/; revision=6291

--- include/libcss/computed.h
+++ include/libcss/computed.h
@@ -20,17 +20,30 @@

 typedef struct css_computed_uncommon {
 /*
- * border_spacing
- * clip
- * content
- * counter_increment
- * counter_reset
- * cursor
- * letter_spacing
- * outline_color
- * outline_width
- * quotes
- * word_spacing
+ * border_spacing		  1 + 2(4)	  2(4)
+ * clip				  2 + 4(4)	  4(4)
+ * counter_increment		  1		  4 + sizeof(ptr)
+ * counter_reset		  1		  4 + sizeof(ptr)
+ * letter_spacing		  1 + 4		  4
+ * outline_color		  1		  4
+ * outline_width		  3 + 4		  4
+ * word_spacing			  1 + 4		  4
+ * 				---		---
+ * 				 47 bits	 48 + 2sizeof(ptr) bytes
+ *
+ * quotes			  1		  sizeof(ptr)
+ * 				---		---
+ * 				  1 bit		  sizeof(ptr) bytes
+ *
+ * content			?
+ * cursor			?
+ *
+ * 				___		___
+ * 				 48 bits	 48 + 3sizeof(ptr) bytes
+ *
+ * 				  6 bytes	 48 + 3sizeof(ptr) bytes
+ * 				===================
+ * 				 54 + 3sizeof(ptr) bytes
  */
 } css_computed_uncommon;


hwrng: fix spelling mistake in header comment

Cc: Herbert Xu <ef65de1c7be0aa837fe7b25ba9a7739905af6a55@gondor.apana.org.au>
Cc: Matt Mackall <4121265491a72225438dfd0e91a228f361407ae2@selenic.com>
Signed-off-by: Sasha Levin <611d453c03d02ce713e72b62ff6a901ea7e9cd77@gmail.com>
Signed-off-by: Jiri Kosina <ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz>

--- include/linux/hw_random.h
+++ include/linux/hw_random.h
@@ -25,7 +25,7 @@
  *			there is always data available.  *OBSOLETE*
  * @data_read:		Read data from the RNG device.
  *			Returns the number of lower random bytes in "data".
- *			Must not be NULL.    *OSOLETE*
+ *			Must not be NULL.    *OBSOLETE*
  * @read:		New API. drivers can fill up to max bytes of data
  *			into the buffer. The buffer is aligned for any type.
  * @priv:		Private data, for use by the RNG driver.


gso: Stop fraglists from escaping

gso: Stop fraglists from escaping

As it stands skb fraglists can get past the check in dev_queue_xmit
if the skb is marked as GSO.  In particular, if the packet doesn't
have the proper checksums for GSO, but can otherwise be handled by
the underlying device, we will not perform the fraglist check on it
at all.

If the underlying device cannot handle fraglists, then this will
break.

The fix is as simple as moving the fraglist check from the device
check into skb_gso_ok.

This has caused crashes with Xen when used together with GRO which
can generate GSO packets with fraglists.

Signed-off-by: Herbert Xu <ef65de1c7be0aa837fe7b25ba9a7739905af6a55@gondor.apana.org.au>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- include/linux/netdevice.h
+++ include/linux/netdevice.h
@@ -1903,15 +1903,14 @@

 static inline int skb_gso_ok(struct sk_buff *skb, int features)
 {
-	return net_gso_ok(features, skb_shinfo(skb)->gso_type);
+	return net_gso_ok(features, skb_shinfo(skb)->gso_type) &&
+	       (!skb_shinfo(skb)->frag_list || (features & NETIF_F_FRAGLIST));
 }

 static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
 {
 	return skb_is_gso(skb) &&
 	       (!skb_gso_ok(skb, dev->features) ||
-	        (skb_shinfo(skb)->frag_list &&
-	         !(dev->features & NETIF_F_FRAGLIST)) ||
 		unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
 }


get rid of boilerplate switches in posix_acl.h

the only potentially subtle thing here: get_cached_acl()
is never called with the second argument other than
ACL_TYPE_{ACCESS,DEFAULT}.  IOW, that return ERR_PTR(-EINVAL)
in there might as well be BUG().

Signed-off-by: Al Viro <de609eb4d5d70b1d38ec6642adbfc33a2781f63c@zeniv.linux.org.uk>

--- include/linux/posix_acl.h
+++ include/linux/posix_acl.h
@@ -84,20 +84,22 @@
 extern int set_posix_acl(struct inode *, int, struct posix_acl *);

 #ifdef CONFIG_FS_POSIX_ACL
+static inline struct posix_acl **acl_by_type(struct inode *inode, int type)
+{
+	switch (type) {
+	case ACL_TYPE_ACCESS:
+		return &inode->i_acl;
+	case ACL_TYPE_DEFAULT:
+		return &inode->i_default_acl;
+	default:
+		BUG();
+	}
+}
+
 static inline struct posix_acl *get_cached_acl(struct inode *inode, int type)
 {
-	struct posix_acl **p, *acl;
-	switch (type) {
-	case ACL_TYPE_ACCESS:
-		p = &inode->i_acl;
-		break;
-	case ACL_TYPE_DEFAULT:
-		p = &inode->i_default_acl;
-		break;
-	default:
-		return ERR_PTR(-EINVAL);
-	}
-	acl = ACCESS_ONCE(*p);
+	struct posix_acl **p = acl_by_type(inode, type);
+	struct posix_acl *acl = ACCESS_ONCE(*p);
 	if (acl) {
 		spin_lock(&inode->i_lock);
 		acl = *p;
@@ -110,18 +112,8 @@

 static inline int negative_cached_acl(struct inode *inode, int type)
 {
-	struct posix_acl **p, *acl;
-	switch (type) {
-	case ACL_TYPE_ACCESS:
-		p = &inode->i_acl;
-		break;
-	case ACL_TYPE_DEFAULT:
-		p = &inode->i_default_acl;
-		break;
-	default:
-		BUG();
-	}
-	acl = ACCESS_ONCE(*p);
+	struct posix_acl **p = acl_by_type(inode, type);
+	struct posix_acl *acl = ACCESS_ONCE(*p);
 	if (acl)
 		return 0;
 	return 1;
@@ -131,18 +123,11 @@
 				  int type,
 				  struct posix_acl *acl)
 {
-	struct posix_acl *old = NULL;
+	struct posix_acl **p = acl_by_type(inode, type);
+	struct posix_acl *old;
 	spin_lock(&inode->i_lock);
-	switch (type) {
-	case ACL_TYPE_ACCESS:
-		old = inode->i_acl;
-		inode->i_acl = posix_acl_dup(acl);
-		break;
-	case ACL_TYPE_DEFAULT:
-		old = inode->i_default_acl;
-		inode->i_default_acl = posix_acl_dup(acl);
-		break;
-	}
+	old = *p;
+	*p = posix_dup_acl(acl);
 	spin_unlock(&inode->i_lock);
 	if (old != ACL_NOT_CACHED)
 		posix_acl_release(old);
@@ -150,18 +135,11 @@

 static inline void forget_cached_acl(struct inode *inode, int type)
 {
-	struct posix_acl *old = NULL;
+	struct posix_acl **p = acl_by_type(inode, type);
+	struct posix_acl *old;
 	spin_lock(&inode->i_lock);
-	switch (type) {
-	case ACL_TYPE_ACCESS:
-		old = inode->i_acl;
-		inode->i_acl = ACL_NOT_CACHED;
-		break;
-	case ACL_TYPE_DEFAULT:
-		old = inode->i_default_acl;
-		inode->i_default_acl = ACL_NOT_CACHED;
-		break;
-	}
+	old = *p;
+	*p = ACL_NOT_CACHED;
 	spin_unlock(&inode->i_lock);
 	if (old != ACL_NOT_CACHED)
 		posix_acl_release(old);


ADT: windows itanium targets msvcrt.dll

ADT: windows itanium targets msvcrt.dll

Update the isOSMSVCRT to correctly identify that windows-itanium uses
msvcrt.dll.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@222389 91177308-0d34-0410-b5e6-96231b3b80d8

--- include/llvm/ADT/Triple.h
+++ include/llvm/ADT/Triple.h
@@ -397,7 +397,8 @@

   /// \brief Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
   bool isOSMSVCRT() const {
-    return isWindowsMSVCEnvironment() || isWindowsGNUEnvironment();
+    return isWindowsMSVCEnvironment() || isWindowsGNUEnvironment() ||
+           isWindowsItaniumEnvironment();
   }

   /// \brief Tests whether the OS is Windows.


Use std::string() instead of std::string("").

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@78364 91177308-0d34-0410-b5e6-96231b3b80d8

--- include/llvm/ADT/Triple.h
+++ include/llvm/ADT/Triple.h
@@ -94,7 +94,7 @@
   /// @name Constructors
   /// @{

-  Triple() : Data(""), Arch(InvalidArch) {}
+  Triple() : Data(), Arch(InvalidArch) {}
   explicit Triple(const StringRef &Str) : Data(Str), Arch(InvalidArch) {}
   explicit Triple(const char *ArchStr, const char *VendorStr, const char *OSStr)
     : Data(ArchStr), Arch(InvalidArch) {


fixed the specifications of the __attribute__format__ macro

git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@45409 d31e2699-5ff4-0310-a27c-f18f2fbe73fe

--- include/parrot/compiler.h
+++ include/parrot/compiler.h
@@ -25,7 +25,7 @@
 #  endif
 #endif
 #ifdef HASATTRIBUTE_FORMAT
-#  define __attribute__format__(x, y, z)    __attribute__((__format__((x), (y), (z))))
+#  define __attribute__format__(x, y, z)    __attribute__((format(x,y,z)))
 #endif
 #ifdef HASATTRIBUTE_MALLOC
 #  define __attribute__malloc__             __attribute__((__malloc__))


Fix string matching.

Fix string matching.

--- include/pattern_element.h
+++ include/pattern_element.h
@@ -124,15 +124,16 @@
     }
     bool match(const char* value)
     {
+        std::string temp = value + 1;
         switch(this->sign)
         {
-            case SignType::Equal:
+            case SignType::Equal:;
+                return temp == this->value;
+            case SignType::Any:
             {
-                std::string temp = value + 1;
-                return temp == this->value;
+                this->size = (int) strlen(value) + 1;
+                return true;
             }
-            case SignType::Any:
-                return true;
         }
     }
 };


include/psp2/moduleinfo.h: Fix for C++

include/psp2/moduleinfo.h: Fix for C++

--- include/psp2/moduleinfo.h
+++ include/psp2/moduleinfo.h
@@ -49,28 +49,8 @@
  * \param module_name Name
  */

-#ifdef __cplusplus
-
 /* Declare a module.  This must be specified in the source of a library or executable. */
-#define PSP2_MODULE_INFO(attribute, version, module_name)	\
-	__asm__ (".section .sceLib.stub, \"a\", %progbits;");	\
-	extern SceModuleInfo module_info	\
-		__attribute__((section(".sceModuleInfo.rodata")))	\
-			= {	\
-		attribute,	\
-		version,	\
-		#module_name,	\
-		0,	\
-		NULL,	\
-		0,	\
-		0,	\
-		0,	\
-		0,	\
-		0,	\
-	};
-#else
-/* Declare a module.  This must be specified in the source of a library or executable. */
-#define PSP2_MODULE_INFO(attribute, version, module_name)	\
+#define _PSP2_MODULE_INFO_(attribute, version, module_name)	\
 	__asm__ (".section .sceLib.stub, \"a\", %progbits;");	\
 	SceModuleInfo module_info	\
 		__attribute__((section(".sceModuleInfo.rodata")))	\
@@ -82,6 +62,12 @@
 		.gp = NULL,	\
 		.nid = 0,	\
 	};
+
+#ifdef __cplusplus
+#define PSP2_MODULE_INFO(attribute, version, module_name)	\
+	extern "C" { _PSP2_MODULE_INFO_(attribute, version, module_name) }
+#else
+#define PSP2_MODULE_INFO _PSP2_MODULE_INFO_
 #endif

 #endif


Update prototype of OnPublicCall()

Update prototype of OnPublicCall()

--- include/sampgdk/interop.h
+++ include/sampgdk/interop.h
@@ -142,12 +142,14 @@
  *
  * \param amx The AMX instance on which the public function is called.
  * \param name The name of the function.
- * \param params The function's arguments as stored on the AMX stack, with the
- * \c params[0] equal to the number of arguments multiplied by \c sizeof(cell).
+ * \param params The function's arguments as stored on the AMX stack, with
+ * \c params[0] set to the number of arguments multiplied by \c sizeof(cell).
+ * \param retval The function's return value. This parameter can be \c NULL.
  *
  * \returns If returns \c true the callback is executed, otherwise it's ignored.
  */
-SAMPGDK_CALLBACK(bool, OnPublicCall(AMX *amx, const char *name, cell *params));
+SAMPGDK_CALLBACK(bool, OnPublicCall(AMX *amx, const char *name, cell *params,
+                                    cell *retval));

 /** @} */


remove heinous comment typo

remove heinous comment typo

--- include/swift/AST/Types.h
+++ include/swift/AST/Types.h
@@ -732,7 +732,7 @@
   /// \code
   /// struct X<T, U> { }
   /// extension X {
-  ///   typealias SomeArray = [T];
+  ///   typealias SomeArray = [T]
   /// }
   /// \endcode
   ///


fix a bug where FunctionType wasn't getting set as containing an Unresolved type in some cases.
Fixing this causes a regression in generic argument deduction, presumably because something
deep in the generics overload set pruning logic isn't handling function types with unresolved
components.  For now, I'm disabling the tests that check for this, but I'd obviously appreciate
it if someone could take a look.

Swift SVN r2527

--- include/swift/AST/Types.h
+++ include/swift/AST/Types.h
@@ -847,10 +847,11 @@
   const Type Input;
   const Type Output;
 protected:
-  AnyFunctionType(TypeKind kind, ASTContext *canTypeContext,
-                  Type input, Type output, bool isUnresolved)
-    : TypeBase(kind, canTypeContext, /*unresolved*/ false),
-      Input(input), Output(output) {
+  AnyFunctionType(TypeKind Kind, ASTContext *CanTypeContext,
+                  Type Input, Type Output, bool isUnresolved)
+    : TypeBase(Kind, CanTypeContext,
+               Input->isUnresolvedType() || Output->isUnresolvedType()),
+      Input(Input), Output(Output) {
   }

 public:


ASoC: topology: ABI - Add name element to snd_soc_tplg_stream

For codec-codec links, this struct will be mapped to the DAI links's
params, which is struct snd_soc_pcm_stream and it needs a stream name.

Signed-off-by: Vedang Patel <8830094f57637f6f13056d546351c69aa6d60978@intel.com>
Signed-off-by: Mengdong Lin <ac87c9ff77e1b1b91a4205a4fd089f74fbeac283@intel.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@kernel.org>


Move-Assignment implemented as specified (#63).

--- include/unique_resource.h
+++ include/unique_resource.h
@@ -234,8 +234,23 @@
             if( this != &other )
             {
                 reset();
-                m_resource = std::move(other.m_resource);
-                m_deleter = std::move(other.m_deleter);
+
+                if( std::is_nothrow_move_assignable<R>::value == true )
+                {
+                    m_deleter.reset(forward_if_nothrow_move_constructible(other.m_deleter.get()));
+                    m_resource.reset(std::forward<RR>(other.m_resource.get()));
+                }
+                else if( std::is_nothrow_move_assignable<D>::value == true )
+                {
+                    m_resource.reset(forward_if_nothrow_move_constructible(other.m_resource.get()));
+                    m_deleter.reset(std::forward<DD>(other.m_deleter.get()));
+                }
+                else
+                {
+                    m_resource = other.m_resource;
+                    m_deleter = other.m_deleter;
+                }
+
                 m_execute_on_destruction = std::exchange(other.m_execute_on_destruction, false);
             }
             return *this;


Working on fixing bug in Utilities::IO::ReadCSVnumerical2().

--- include/utilities_slsim.h
+++ include/utilities_slsim.h
@@ -1597,33 +1597,37 @@
       std::stringstream          lineStream(line);
       std::string                cell;
       column_names.empty();
-
-      while(std::getline(lineStream,cell,deliniator))
-      {
+      size_t ii = 0;
+
+      if(header){
+        while(std::getline(lineStream,cell,deliniator))
+        {
+            column_names.push_back(cell);
+        }
+
+        // This checks for a trailing comma with no data after it.
+        if (!lineStream && cell.empty())
+        {
+            column_names.push_back("");
+        }
+      }else{
+
+        while(std::getline(lineStream,cell,deliniator))
+        {
           column_names.push_back(cell);
-      }
-
-      // This checks for a trailing comma with no data after it.
-      if (!lineStream && cell.empty())
-      {
-          column_names.push_back("");
-      }
-
-      int columns = NumberOfEntries(line,deliniator);
-
-      size_t ii = 0;
-
-      for(auto &v : data ) v.empty();
-
-      if(!header){
-        data.emplace_back(columns);
+        }
+
+        data.emplace_back(column_names.size());
         int i=0;
         for(auto a : column_names){
           data.back()[i++] = to_numeric<T>(a);
         }
-         ++ii;
-      }
-
+        ++ii;
+      }
+
+      int columns = NumberOfEntries(line,deliniator);
+
+      for(auto &v : data ) v.empty();

       while(std::getline(file,line) && ii < Nmax){

@@ -1636,6 +1640,7 @@
         int i=0;
         while(std::getline(lineStream,cell, deliniator))
         {
+          assert(i < columns);
           data.back()[i] = to_numeric<T>(cell);
           ++i;
         }


Refactored interface parameter list.

Refactored interface parameter list.

Added pending and available counters for both RX and TX queues.
Added watermark counters for RX and TX queues.

--- include/xcore/interface.h
+++ include/xcore/interface.h
@@ -14,44 +14,66 @@
 /*----------------------------------------------------------------------------*/
 #include <xcore/entity.h>
 /*----------------------------------------------------------------------------*/
-/** Interface options. */
+/** Interface parameters. */
 enum IfParameter
 {
-  /** Elements available in the receive queue. */
-  IF_AVAILABLE,
-  /** Elements pending in the transmit queue. */
-  IF_PENDING,
+  /**
+   * Number of elements available in the receive queue.
+   * Parameter type is \a size_t.
+   */
+  IF_RX_AVAILABLE,
+  /** Free space in the receive queue. Parameter type is \a size_t. */
+  IF_RX_PENDING,
+  /**
+   * Maximum number of elements in the receive queue.
+   * Parameter type is \a size_t.
+   */
+  IF_RX_WATERMARK,
+  /**
+   * Number of pending elements in the transmit queue.
+   * Parameter type is \a size_t.
+   */
+  IF_TX_AVAILABLE,
+  /** Free space in the transmit queue. Parameter type is \a size_t. */
+  IF_TX_PENDING,
+  /**
+   * Maximum number of elements in the transmit queue.
+   * Parameter type is \a size_t.
+   */
+  IF_TX_WATERMARK,

-  /** Unique identifier of the device, 32-bit value. */
+  /**
+   * Unique identifier of the device, 32-bit value.
+   * Parameter type is \a uint32_t.
+   */
   IF_ADDRESS,
-  /** Unique identifier of the device, 64-bit value. */
+  /**
+   * Unique identifier of the device, 64-bit value.
+   * Parameter type is \a uint64_t.
+   */
   IF_ADDRESS_64,
-  /** Priority of interrupts or direct memory access requests. */
-  IF_PRIORITY,
-  /** Data rate. */
+  /** Data rate. Parameter type is \a uint32_t. */
   IF_RATE,

-  /** Alignment of the buffer length for user space buffers. */
-  IF_ALIGNMENT,
-  /** Position in the 32-bit address space. */
+  /** Position in the 32-bit address space. Parameter type is \a uint32_t. */
   IF_POSITION,
-  /** Position in the 64-bit address space. */
+  /** Position in the 64-bit address space. Parameter type is \a uint64_t. */
   IF_POSITION_64,
-  /** Size of the available space in a 32-bit address space. */
+  /** Volume size, 32-bit value. Parameter type is \a uint32_t. */
   IF_SIZE,
-  /** Size of the available space in a 64-bit address space. */
+  /** Volume size, 64-bit value. Parameter type is \a uint64_t. */
   IF_SIZE_64,
-  /** Size of a data word in bits. */
+  /** Size of a data word in bits. Parameter type is \a uint32_t. */
   IF_WIDTH,

   /**
-   * Stop the interface from reading a new data. Data pointer should be set
-   * to zero.
+   * Stop the interface from reading a new data.
+   * Data pointer should be set to zero.
    */
   IF_DISABLE,
   /**
-   * Enable a reception of a new data. Data pointer should be set
-   * to zero.
+   * Enable a reception of a new data.
+   * Data pointer should be set to zero.
    */
   IF_ENABLE,
   /**
@@ -61,19 +83,16 @@
   IF_STATUS,

   /**
-   * Select blocking mode for the interface. Data pointer should be set
-   * to zero.
+   * Selects blocking mode for the interface. Read and write calls are blocked
+   * until all data has been received or transmitted.
+   * Data pointer should be set to zero.
    */
   IF_BLOCKING,
   /**
-   * Select non-blocking mode for the interface. Data pointer should be set
-   * to zero.
-   */
-  IF_NONBLOCKING,
-  /**
-   * Select zero-copy mode for the interface. Data pointer should be set
-   * to zero. This mode is similar to the non-blocking mode except for
-   * user space buffers being unavailable until the transfer completion.
+   * Selects zero-copy mode for the interface. Read and write calls
+   * will not block and will immediately return the number of items added.
+   * User space buffers are unavailable until the transfer is complete.
+   * Data pointer should be set to zero.
    */
   IF_ZEROCOPY,


Removed stray GetNextDocument declaration from the parser (it's from the old API, and not the new one)

--- include/yaml-cpp/parser.h
+++ include/yaml-cpp/parser.h
@@ -31,9 +31,7 @@

 		void Load(std::istream& in);
 		bool HandleNextDocument(EventHandler& eventHandler);
-
-		bool GetNextDocument(Node& document); // old API only
-
+
 		void PrintTokens(std::ostream& out);

 	private:


devices:epiphany: Implement p_map for simulator

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

--- src/base/devices/epiphany/simulator.c
+++ src/base/devices/epiphany/simulator.c
@@ -100,6 +100,23 @@
     return 0;
 }

+static void *dev_map(struct dev *dev, unsigned long addr, unsigned long size)
+{
+    /* HACK */
+
+    struct epiphany_dev *epiphany = to_epiphany_dev(dev);
+
+    if (addr < 0x8e000000 || 32*1024*1024 < addr - 0x8e000000 + size)
+        return NULL;
+
+    {
+        uintptr_t offset = addr - 0x8e000000;
+        uint8_t *ptr = epiphany->eram;
+        return &ptr[offset];
+    }
+}
+
+
 static uint32_t reg_read(struct epiphany_dev *epiphany, uintptr_t base,
                          uintptr_t offset)
 {
@@ -140,5 +157,6 @@
     .early_init = dev_early_init,
     .late_fini = dev_late_fini,
     .map_member = dev_map_member,
+    .map = dev_map,
     .unmap = dev_unmap,
 };


Open cache files with O_EXCL

Open cache files with O_EXCL

git-svn-id: 73370f4beb622e00b1e5fc4f999aefcb9ce2f227@46830 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/bin/efreet_desktop_cache_create.c
+++ src/bin/efreet_desktop_cache_create.c
@@ -191,7 +191,7 @@
         if (errno != ENOENT) goto efreet_error;
     }
     /* create desktop cache file, so that efreet_init wont run another instance of this program */
-    fd = open(efreet_desktop_cache_file(), O_CREAT | O_TRUNC | O_RDONLY, S_IRUSR | S_IWUSR);
+    fd = open(efreet_desktop_cache_file(), O_CREAT | O_EXCL | O_RDONLY, S_IRUSR | S_IWUSR);
     if (fd < 0) goto efreet_error;
     close(fd);

@@ -205,7 +205,7 @@
         if (errno != ENOENT) goto efreet_error;
     }
     /* create util cache file */
-    fd = open(efreet_util_cache_file(), O_CREAT | O_TRUNC | O_RDONLY, S_IRUSR | S_IWUSR);
+    fd = open(efreet_util_cache_file(), O_CREAT | O_EXCL | O_RDONLY, S_IRUSR | S_IWUSR);
     if (fd < 0) goto efreet_error;
     close(fd);


Fix help message for pg_basebackup -R

Fix help message for pg_basebackup -R

The recovery.conf file that's generated is specifically for
replication, and not needed (or wanted) for regular backup restore, so
indicate that in the message.

--- src/bin/pg_basebackup/pg_basebackup.c
+++ src/bin/pg_basebackup/pg_basebackup.c
@@ -237,7 +237,7 @@
 	printf(_("  -r, --max-rate=RATE    maximum transfer rate to transfer data directory\n"
 			 "                         (in kB/s, or use suffix \"k\" or \"M\")\n"));
 	printf(_("  -R, --write-recovery-conf\n"
-			 "                         write recovery.conf after backup\n"));
+			 "                         write recovery.conf for replication\n"));
 	printf(_("  -T, --tablespace-mapping=OLDDIR=NEWDIR\n"
 	  "                         relocate tablespace in OLDDIR to NEWDIR\n"));
 	printf(_("  -x, --xlog             include required WAL files in backup (fetch mode)\n"));


Cleanup: clang format, warning

Cleanup: clang format, warning

--- src/kernel/closure/bsdf.h
+++ src/kernel/closure/bsdf.h
@@ -458,7 +458,8 @@
   }
   else {
     /* Shadow terminator offset. */
-    const float frequency_multiplier = kernel_tex_fetch(__objects, sd->object).shadow_terminator_offset;
+    const float frequency_multiplier =
+        kernel_tex_fetch(__objects, sd->object).shadow_terminator_offset;
     if (frequency_multiplier > 1.0f) {
       *eval *= shift_cos_in(dot(*omega_in, sc->N), frequency_multiplier);
     }
@@ -581,7 +582,8 @@
       }
     }
     /* Shadow terminator offset. */
-    const float frequency_multiplier = kernel_tex_fetch(__objects, sd->object).shadow_terminator_offset;
+    const float frequency_multiplier =
+        kernel_tex_fetch(__objects, sd->object).shadow_terminator_offset;
     if (frequency_multiplier > 1.0f) {
       eval *= shift_cos_in(dot(omega_in, sc->N), frequency_multiplier);
     }


Added direct access to the ParticleGroup index list.
Also grouped the particle group documentation for easier reading.

git-svn-id: 83d030380b3db5e3cda90b2a671ffa608feb519b@2209 fa922fa7-2fde-0310-acd8-f43f465a7996

--- src/data_structures/ParticleGroup.h
+++ src/data_structures/ParticleGroup.h
@@ -79,7 +79,7 @@
     aquired. Thus, all get() methods must return values from internal cached variables only. Those methods that
     absolutely require the particle data be released before they are called will be documented as such.

-    \b Data Structures and Implementation
+    <b>Data Structures and Implementation</b>

     The initial and fundamental data structure in the group is a vector listing all of the particle tags in the group,
     in a sorted tag order. This list can be accessed directly via getMemberTag() to meet the 2nd use case listed above.
@@ -103,7 +103,10 @@
             type,   //!< Select particles in the group by type
             tag     //!< Select particles in the group by tag
             };
-
+
+        //! \name Initialization methods
+        // @{
+
         //! Constructs an empty particle group
         ParticleGroup() {};

@@ -113,6 +116,10 @@
         //! Destructor
         ~ParticleGroup();

+        // @}
+        //! \name Accessor methods
+        // @{
+
         //! Get the number of members in the group
         /*! \returns The number of particles that belong to this group
         */
@@ -152,12 +159,26 @@
             {
             return m_is_member[idx];
             }
+
+        //! Direct access to the index list
+        /*! \returns A GPUArray for directly accessing the index list, intended for use in using groups on the GPU
+            \note The caller \b must \b not write to or change the array.
+        */
+        const GPUArray<unsigned int>& getIndexArray()
+            {
+            return m_member_idx;
+            }
+
+        // @}
+        //! \name Combination methods
+        // @{

         //! Make a new particle group from a union of two
         static boost::shared_ptr<ParticleGroup> groupUnion(boost::shared_ptr<ParticleGroup> a, boost::shared_ptr<ParticleGroup> b);
         //! Make a new particle group from an intersection
         static boost::shared_ptr<ParticleGroup> groupIntersection(boost::shared_ptr<ParticleGroup> a, boost::shared_ptr<ParticleGroup> b);

+        // @}

     private:
         boost::shared_ptr<ParticleData> m_pdata;        //!< The particle data this group is associated with


Fix parameter name in comment to match signature (#2973)

--- OpenSim/Common/Component.h
+++ OpenSim/Common/Component.h
@@ -1604,7 +1604,7 @@
      *
      * @param state
      *     the State in which to store the new value
-     * @param name
+     * @param k
      *     the name of the cache variable
      * @param value
      *     the new value for this cache variable


Added some syscalls to Linux (not checked)

--- src/kernel/linux/common.h
+++ src/kernel/linux/common.h
@@ -35,6 +35,7 @@
 # define SYS_chmod		15
 # define SYS_lseek		19
 # define SYS_getpid		20
+# define SYS_mount		21
 # define SYS_alarm		27
 # define SYS_utime		30
 # define SYS_access		33
@@ -49,6 +50,7 @@
 # define SYS_times		43
 # define SYS_brk		45
 # define SYS_signal		48
+# define SYS_unmount		52
 # define SYS_ioctl		54
 # define SYS_fcntl		55
 # define SYS_setpgid		57
@@ -73,8 +75,13 @@
 # define SYS_wait4		114
 # define SYS_fsync		118
 # define SYS_uname		122
+# define SYS_mprotect		125
 # define SYS_fchdir		133
+# define SYS_mlock		150
+# define SYS_munlock		151
 # define SYS_nanosleep		162
+# define SYS_poll		168
+# define SYS_sigprocmask	175
 # define SYS_getcwd		183
 # define SYS_vfork		190
 # define SYS_getrlimit		191


Do not return 'DFB_INVARG' in 'SetBackgroundMode()' on success, could irritate someone ;)

--- src/display/idirectfbdisplaylayer.c
+++ src/display/idirectfbdisplaylayer.c
@@ -267,7 +267,7 @@
                     if (background_mode != DLBM_DONTCARE)
                          windowstack_repaint_all( data->layer->windowstack );
                }
-               break;
+               return DFB_OK;
      }

      return DFB_INVARG;


Test use of arm_neon.h with -fno-lax-vector-conversions.

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

--- test/Headers/arm-neon-header.c
+++ test/Headers/arm-neon-header.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s
+// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -fno-lax-vector-conversions -verify %s
 // RUN: %clang_cc1 -x c++ -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s

 #include <arm_neon.h>


Fix mismatching open/close

Fix mismatching open/close

--- src/methods.c
+++ src/methods.c
@@ -25,13 +25,13 @@
 	if ( fgets( date_result, 2048, piped ) == NULL )
 	{
 		if ( piped != NULL )
-			fclose(piped);
+			pclose(piped);

 		sprintf( date_result, "date get failed" );
 		return -1;
 	}

-	fclose(piped);
+	pclose(piped);
 	fprintf( log, "DATE: %s", date_result );

 	return 0;
@@ -1063,4 +1063,3 @@

 	fclose(vid_log);
 }
-


mesh: shell: Add LPN subscription commands to mesh shell

X-Original-Commit: 1409b61d162858308030c2f9c3dbd18fd0d89b73

--- nimble/host/mesh/src/shell.c
+++ nimble/host/mesh/src/shell.c
@@ -25,6 +25,7 @@
 /* Private includes for raw Network & Transport layer access */
 #include "net.h"
 #include "mesh_priv.h"
+#include "lpn.h"
 #include "transport.h"
 #include "foundation.h"

@@ -790,6 +791,50 @@
 	bt_mesh_rpl_clear();
 	return 0;
 }
+
+#if MYNEWT_VAL(BLE_MESH_LOW_POWER)
+static int cmd_lpn_subscribe(int argc, char *argv[])
+{
+	u16_t address;
+
+	if (argc < 2) {
+		return -EINVAL;
+	}
+
+	address = strtoul(argv[1], NULL, 0);
+
+	printk("address 0x%04x", address);
+
+	bt_mesh_lpn_group_add(address);
+
+	return 0;
+}
+
+struct shell_cmd_help cmd_lpn_subscribe_help = {
+	NULL, "<addr>", NULL
+};
+
+static int cmd_lpn_unsubscribe(int argc, char *argv[])
+{
+	u16_t address;
+
+	if (argc < 2) {
+		return -EINVAL;
+	}
+
+	address = strtoul(argv[1], NULL, 0);
+
+	printk("address 0x%04x", address);
+
+	bt_mesh_lpn_group_del(&address, 1);
+
+	return 0;
+}
+
+struct shell_cmd_help cmd_lpn_unsubscribe_help = {
+	NULL, "<addr>", NULL
+};
+#endif

 static int cmd_iv_update_test(int argc, char *argv[])
 {
@@ -2078,6 +2123,10 @@
 	{ "iv-update", cmd_iv_update, NULL },
 	{ "iv-update-test", cmd_iv_update_test, &cmd_iv_update_test_help },
 	{ "rpl-clear", cmd_rpl_clear, NULL },
+#if MYNEWT_VAL(BLE_MESH_LOW_POWER)
+	{ "lpn-subscribe", cmd_lpn_subscribe, &cmd_lpn_subscribe_help },
+	{ "lpn-unsubscribe", cmd_lpn_unsubscribe, &cmd_lpn_unsubscribe_help },
+#endif

 	/* Configuration Client Model operations */
 	{ "get-comp", cmd_get_comp, &cmd_get_comp_help },


Moved up 'Game Systems' since several of them are Safari-based.

--- browsers.c
+++ browsers.c
@@ -85,6 +85,16 @@
   /* Mozilla Firefox */
   {"Firefox", "Firefox"},

+  /* Game systems: some of them are Safari-based,
+   * thus they need to go before Safari */
+  {"Xbox One", "Game Systems"},
+  {"Xbox", "Game Systems"},
+  {"PlayStation", "Game Systems"},
+  {"NintendoBrowser", "Game Systems"},
+  {"Steam GameOverlay", "Game Systems"},
+  {"Origin", "Game Systems"},
+  {"Raptr", "Game Systems"},
+
   /* Chrome has to go before Safari */
   {"Chrome", "Chrome"},
   {"CriOS", "Chrome"},
@@ -119,15 +129,6 @@
   {"Netvibes", "Feeds"},
   {"NewsBlur", "Feeds"},
   {"YandexBlogs", "Feeds"},
-
-  /* Game systems */
-  {"Xbox One", "Game systems"},
-  {"Xbox", "Game systems"},
-  {"PlayStation", "Game systems"},
-  {"NintendoBrowser", "Game systems"},
-  {"Steam GameOverlay", "Game systems"},
-  {"Origin", "Game systems"},
-  {"Raptr", "Game systems"},

   /* Crawlers/Bots */
   {"AdsBot-Google", "Crawlers"},


Add member function to check if table has a column by given index.

--- OpenSim/Common/DataTable.h
+++ OpenSim/Common/DataTable.h
@@ -229,6 +229,11 @@
         return false;
     }

+    /** Check if the table has a column with the given index.                 */
+    bool hasColumn(const size_t columnIndex) const {
+        return columnIndex < getNumColumns();
+    }
+
 protected:
     /** Get number of rows. Implemented by derived classes.                   */
     virtual size_t implementGetNumRows() const       = 0;


oops, remove duplicated code from sched.c and sched_lock.h

--- src/kernel/thread/sched.c
+++ src/kernel/thread/sched.c
@@ -281,36 +281,3 @@
 	return 0;
 }

-
-/**
- * Locks the scheduler which means disabling thread switch until
- * #sched_unlock() is called. Each lock must be balanced with the corresponding
- * unlock.
- *
- * @see sched_unlock()
- */
-void sched_lock(void) {
-	critical_enter(CRITICAL_SCHED_LOCK);
-}
-
-/**
- * Unlocks the scheduler after #sched_lock(). Must be called on the
- * previously locked scheduler only. Outermost unlock (which corresponds to
- * the first lock call) also dispatches pending thread switches (if any).
- *
- * @see sched_lock()
- */
-void sched_unlock(void) {
-	critical_leave(CRITICAL_SCHED_LOCK);
-	critical_dispatch_pending();
-}
-
-/**
- * Does the same as #sched_unlock() except that the outermost call does not
- * perform a check for pending switches.
- *
- * @note This function is not intended for wide usage.
- */
-void sched_unlock_noswitch(void) {
-	critical_leave(CRITICAL_SCHED_LOCK);
-}


[hack] remove use of ushort in hh_shared

Summary: `ushort` doesn't exist in mingw (Windows). replaced with `uint16_t` to maintain the same behavior, even though it seems like `uint8_t` would probably be better here.

Reviewed By: gabelevi, 2BitSalute

Differential Revision: D15781630

fbshipit-source-id: ce268904737918b9f6ef2c6d655c52979b0055a7

--- hack/heap/hh_shared.c
+++ hack/heap/hh_shared.c
@@ -2177,7 +2177,7 @@

   // TODO: read MAGIC_CONSTANT
   // TODO: read the format version
-  ushort is_key = 1;
+  uint16_t is_key = 1;
   tagged_uint_t slot;
   tagged_uint_t key;
   tagged_uint_t value;


wosi_driver.c: replace gpio*.%02d as gpio*.%d


bletiny - Use new GATT registration API.

--- apps/bletiny/src/gatt_svr.c
+++ apps/bletiny/src/gatt_svr.c
@@ -429,24 +429,24 @@
     switch (op) {
     case BLE_GATT_REGISTER_OP_SVC:
         BLETINY_LOG(DEBUG, "registered service %s with handle=%d\n",
-                    gatt_svr_uuid_to_s(ctxt->svc_reg.svc->uuid128, buf),
-                    ctxt->svc_reg.handle);
+                    gatt_svr_uuid_to_s(ctxt->svc.svc_def->uuid128, buf),
+                    ctxt->svc.handle);
         break;

     case BLE_GATT_REGISTER_OP_CHR:
         BLETINY_LOG(DEBUG, "registering characteristic %s with "
                            "def_handle=%d val_handle=%d\n",
-                    gatt_svr_uuid_to_s(ctxt->chr_reg.chr->uuid128, buf),
-                    ctxt->chr_reg.def_handle,
-                    ctxt->chr_reg.val_handle);
+                    gatt_svr_uuid_to_s(ctxt->chr.chr_def->uuid128, buf),
+                    ctxt->chr.def_handle,
+                    ctxt->chr.val_handle);
         break;

     case BLE_GATT_REGISTER_OP_DSC:
         BLETINY_LOG(DEBUG, "registering descriptor %s with handle=%d "
                            "chr_handle=%d\n",
-                    gatt_svr_uuid_to_s(ctxt->dsc_reg.dsc->uuid128, buf),
-                    ctxt->dsc_reg.dsc_handle,
-                    ctxt->dsc_reg.chr_def_handle);
+                    gatt_svr_uuid_to_s(ctxt->dsc.dsc_def->uuid128, buf),
+                    ctxt->dsc.dsc_handle,
+                    ctxt->dsc.chr_def_handle);
         break;

     default:


Cleanup

Cleanup

--- bspirals.c
+++ bspirals.c
@@ -55,7 +55,6 @@

 // private function, returns a dynamically allocated array of co_ord_t structs
 // that represent all the points in cartesian space occupied by the given spiral
-// TODO: Change this to return a struct, including the count of items!
 static co_ord_array_t
 spiral_points(spiral_t spiral, size_t limit) {
     // the amount of space needed is the sum of all line lengths:
@@ -77,7 +76,6 @@
         // get current direction
         vector_t direction = VECTOR_DIRECTIONS[spiral.lines[i].direction];
         // make as many jumps in this direction as this lines legth
-        // printf("%i\n", spiral.lines[i].length);
         for(uint32_t j = 0; j < spiral.lines[i].length; j++) {
             current.x += direction.x;
             current.y += direction.y;
@@ -123,41 +121,25 @@
 // length, recursively calling self to resize the previous line if that is not
 // possible.
 static spiral_t
-resize_spiral(spiral_t output, size_t index, uint32_t length) {
-    // // allocate new struct as copy of input struct
-    // spiral_t output = { .size = input.size, };
-    // output.lines = calloc(sizeof(line_t), output.size);
-    // // copy across line directions and lengths
-    // for(size_t i = 0; i < output.size; i++) {
-    //     output.lines[i].direction = input.lines[i].direction;
-    //     output.lines[i].length = input.lines[i].length;
-    // }
-    // free(input.lines);
+resize_spiral(spiral_t spiral, size_t index, uint32_t length) {
     // first, set the target line to the target length
-    output.lines[index].length = length;
+    spiral.lines[index].length = length;
     // now, check for collisions
-    bool collides = spiral_collides(output, index+1);
+    bool collides = spiral_collides(spiral, index+1);
     if(collides) {
         // there were collisions, so reset the target line to 1
-        output.lines[index].length = 1;
+        spiral.lines[index].length = 1;
         while(collides) {
             // recursively call resize_spiral(), increasing the size of the
             // previous line until we get something that doesn't collide
-            output = resize_spiral(
-                output, index-1, output.lines[index-1].length+1
+            spiral = resize_spiral(
+                spiral, index-1, spiral.lines[index-1].length+1
             );
-            // // free(output.lines);
-            // output.lines = calloc(sizeof(line_t), workon.size);
-            // // copy across line directions and lengths
-            // for(size_t i = 0; i < workon.size; i++) {
-            //     output.lines[i].direction = workon.lines[i].direction;
-            //     output.lines[i].length = workon.lines[i].length;
-            // }
-            // free(workon.lines);
-            collides = spiral_collides(output, index+1);
+            // check if it still collides
+            collides = spiral_collides(spiral, index+1);
         }
     }
-    return output;
+    return spiral;
 }

 // given a spiral for which the length of all its lines are not yet known,


IndexOutOfRange uses ints to handle -1, etc.

--- OpenSim/Common/Exception.h
+++ OpenSim/Common/Exception.h
@@ -172,9 +172,9 @@
     IndexOutOfRange(const std::string& file,
                     size_t line,
                     const std::string& func,
-                    size_t index,
-                    size_t min,
-                    size_t max) :
+                    int index,
+                    int min,
+                    int max) :
         Exception(file, line, func) {
         std::string msg = "min = " + std::to_string(min);
         msg += " max = " + std::to_string(max);


feat(kernel/type_checker): add swap method

Signed-off-by: Leonardo de Moura <7610bae85f2b530654cc716772f1fe653373e892@microsoft.com>

--- src/kernel/type_checker.h
+++ src/kernel/type_checker.h
@@ -95,6 +95,8 @@
     expr ensure_pi(expr const & t);
     /** \brief Return a Sort if \c t is convertible to Sort. Throw an exception otherwise. */
     expr ensure_sort(expr const & t);
+
+    void swap(type_checker & tc) { std::swap(m_ptr, tc.m_ptr); }
 };

 /**


Fix let*'s implementation (save 'value' pointer temporarily for GC)

--- src/miniscm.c
+++ src/miniscm.c
@@ -358,9 +358,10 @@
 #define dump_envir(p) (car((p) + 2))
 #define dump_code(p)  (cdr((p) + 2))

+pointer dump_base; /* pointer to base of allocated dump stack */
+#endif
+
 pointer save = &_NIL; /* pointer to save temporarily for gc */
-pointer dump_base; /* pointer to base of allocated dump stack */
-#endif

 /* allocate new cell segment */
 int alloc_cellseg(int n)
@@ -703,10 +704,10 @@
 		setmark(p + 1);
 		setmark(p + 2);
 	}
-	mark(save);
 #else
 	mark(dump);
 #endif
+	mark(save);

 	/* mark variables a, b */
 	mark(a);
@@ -1525,11 +1526,13 @@
 		s_goto(OP_EVAL);

 	case OP_LET1AST:	/* let* (make new frame) */
+		save = value;	/* save value for gc */
 		envir = cons(NIL, envir);
 		s_goto(OP_LET2AST);

 	case OP_LET2AST:	/* let* (caluculate parameters) */
 		car(envir) = cons(cons(caar(code), value), car(envir));
+		save = NIL;
 		code = cdr(code);
 		if (ispair(code)) {	/* continue */
 			s_save(OP_LET2AST, args, code);


Win32 joystick fix, ported from 1.2 branch r2887:2888. (Thanks, Ondrej!)

 Fixes Bugzilla #267.

git-svn-id: 75429ccc2030f235ccf16e6b9b7f8e83d5edd22e@2889 c70aab31-4412-0410-b14c-859654838e24


Simplify cell memory segments to one segment

--- src/miniscm.c
+++ src/miniscm.c
@@ -13,9 +13,6 @@
  */
 /*--
  *
- *  This version has been modified by Tatsuya WATANABE.
- *	current version is 0.85w1
- *
  *  This version has been modified by R.C. Secrist.
  *
  *  Mini-Scheme is now maintained by Akira KIDA.
@@ -25,45 +22,11 @@
  *
  *  Please send suggestions, bug reports and/or requests to:
  *		<SDI00379@niftyserve.or.jp>
+ *
+ *  This version has been modified by Tatsuya WATANABE.
+ *	current version is 0.85w1 (2015)
  *--
- */
-
-/*
- * Here is System declaration.
- * Please define exactly one symbol in the following section.
  */
-/* #define LSC		*/	/* LightSpeed C for Macintosh */
-/* #define LSC4		*/	/* THINK C version 4.0 for Macintosh */
-/* #define MPW2		*/	/* Macintosh Programmer's Workshop v2.0x */
-/* #define BSD		*/	/* 4.x BSD */
-/* #define MSC		*/	/* Microsoft C Compiler v.4.00 - 7.00 */
-/* #define TURBOC	*/	/* Turbo C compiler v.2.0, or TC++ 1.0  */
-/* #define SYSV		*/	/* System-V, or POSIX */
-/* #define VAXC		*/	/* VAX/VMS VAXC 2.x or later */ /* (automatic) */
-
-#ifdef __BORLANDC__	/* Borland C++ - MS-DOS */
-#define TURBOC
-#endif
-
-#ifdef __TURBOC__	/* Turbo C V1.5 - MS-DOS */
-#define TURBOC
-#endif
-
-#ifdef mips		/* DECstation running OSF/1 */
-#define BSD
-#endif
-
-#ifdef __osf__		/* Alpha AXP running OSF/1 */
-#define BSD
-#endif
-
-#ifdef __DECC		/* Alpha AXP running VMS */
-#define VAXC
-#endif
-
-#ifdef _AIX		/* RS/6000 running AIX */
-#define BSD
-#endif

 /*
  * Define or undefine following symbols as you need.
@@ -91,18 +54,9 @@
  *  Basic memory allocation units
  */

-#ifdef TURBOC             	/* rcs */
-#define CELL_SEGSIZE  2048
-#define CELL_NSEGMENT  100
-#define STR_SEGSIZE   2048
-#define STR_NSEGMENT   100
-#else
-#define CELL_SEGSIZE    5000	/* # of cells in one segment */
-#define CELL_NSEGMENT   100	/* # of segments for cells */
-#define STR_SEGSIZE     2500	/* bytes of one string segment */
+#define CELL_SEGSIZE 500000	/* # of cells in one segment */
+#define STR_SEGSIZE    2500	/* bytes of one string segment */
 #define STR_NSEGMENT    100	/* # of segments for strings */
-#endif
-

 #define banner "Hello, This is Mini-Scheme Interpreter Version 0.85w1.\n"
@@ -114,94 +68,12 @@
 #include <setjmp.h>
 #endif

-
-/* System dependency */
-#ifdef LSC
-#include <strings.h>
-#include <unix.h>
-#define malloc(x)	NewPtr((long)(x))
-#define prompt "> "
-#define InitFile "init.scm"
-#define FIRST_CELLSEGS 5
-#endif
-
-#ifdef LSC4
-#include <string.h>
-#include <stdlib.h>
-#define malloc(x)	NewPtr((long)(x))
-#define prompt "> "
-#define InitFile "init.scm"
-#define FIRST_CELLSEGS 5
-#endif
-
-#ifdef MPW2
-#include <strings.h>
-#include <memory.h>
-#define malloc(x)	NewPtr((long)(x))
-#define prompt "> [enter at next line]\n"
-#define InitFile "init.scm"
-#define FIRST_CELLSEGS 5
-#endif
-
-#ifdef BSD
-#include <strings.h>
-#include <signal.h>
-#define prompt "> "
-#define InitFile "init.scm"
-#define FIRST_CELLSEGS 10
-#endif
-
-#ifdef MSC
-#include <string.h>
-#include <stdlib.h>
-#include <malloc.h>
-#include <process.h>
-#define prompt "> "
-#define InitFile "init.scm"
-#define FIRST_CELLSEGS 3
-#define snprintf _snprintf
-#endif
-
-#ifdef TURBOC
 #include <string.h>
 #include <stdlib.h>
 #define prompt "> "
 #define InitFile "init.scm"
-#define FIRST_CELLSEGS 3
-#endif
-
-#ifdef SYSV
-#include <string.h>
-#include <malloc.h>
-#if __STDC__
-# include <stdlib.h>
-#endif
-#define prompt "> "
-#define InitFile "init.scm"
-#define FIRST_CELLSEGS 10
-#endif
-
-#ifdef	VAXC
-#include <string.h>
-#include <stdlib.h>
-#define prompt "> "
-#define InitFile "init.scm"
-#define FIRST_CELLSEGS 10
-#endif
-
-#ifdef __GNUC__
-/*
- * If we use gcc, AVOID_HACK_LOOP is unnecessary
- */
-#undef AVOID_HACK_LOOP
-#endif
-
-#ifndef	FIRST_CELLSEGS
-#error Please define your system type.
-/*
- * We refrain this to raise an error anyway even if on pre-ANSI system.
- */
-error Please define your system type.
+#ifdef _WIN32
+#define snprintf _snprintf
 #endif

 /* cell structure */
@@ -236,9 +108,6 @@
 # define T_MACRO       256	/* 0000000100000000 */
 #endif
 #define T_PROMISE      512	/* 0000001000000000 */
-#ifndef USE_SCHEME_STACK
-# define T_DUMPSTACK  1024	/* 0000010000000000 */
-#endif
 #define T_ATOM       16384	/* 0100000000000000 */	/* only for gc */
 #define CLRATOM      49151	/* 1011111111111111 */	/* only for gc */
 #define MARK         32768	/* 1000000000000000 */
@@ -282,11 +151,7 @@
 #define ispromise(p)    (type(p)&T_PROMISE)
 #define setpromise(p)   type(p) |= T_PROMISE

-#ifndef USE_SCHEME_STACK
-# define isdumpstack(p)  (type(p)&T_DUMPSTACK)
-#endif
-
-#define isatom(p)       (type(p)&T_ATOM)
+#define isatom(p)      (type(p)&T_ATOM)
 #define setatom(p)      type(p) |= T_ATOM
 #define clratom(p)      type(p) &= CLRATOM

@@ -305,8 +170,7 @@
 #define cddddr(p)       cdr(cdr(cdr(cdr(p))))

 /* arrays for segments */
-pointer cell_seg[CELL_NSEGMENT];
-int     last_cell_seg = -1;
+pointer cell_seg;
 char   *str_seg[STR_NSEGMENT];
 int     str_seglast = -1;

@@ -365,31 +229,26 @@
 #endif

 /* allocate new cell segment */
-int alloc_cellseg(int n)
+int alloc_cellseg()
 {
 	register pointer p;
 	register long i;
-	register int k;
-
-	for (k = 0; k < n; k++) {
-		if (last_cell_seg >= CELL_NSEGMENT - 1)
-			return k;
-		p = (pointer) malloc(CELL_SEGSIZE * sizeof(struct cell));
-		if (p == (pointer) 0)
-			return k;
-		cell_seg[++last_cell_seg] = p;
-		fcells += CELL_SEGSIZE;
-		for (i = 0; i < CELL_SEGSIZE - 1; i++, p++) {
-			type(p) = 0;
-			car(p) = NIL;
-			cdr(p) = p + 1;
-		}
+
+	p = (pointer)malloc(CELL_SEGSIZE * sizeof(struct cell));
+	if (p == (pointer)0)
+		return 0;
+	free_cell = cell_seg = p;
+	fcells += CELL_SEGSIZE;
+	for (i = 0; i < CELL_SEGSIZE - 1; i++, p++) {
 		type(p) = 0;
 		car(p) = NIL;
-		cdr(p) = free_cell;
-		free_cell = cell_seg[last_cell_seg];
-	}
-	return n;
+		cdr(p) = p + 1;
+	}
+	type(p) = 0;
+	car(p) = NIL;
+	cdr(p) = NIL;
+
+	return 1;
 }

 /* allocate new string segment */
@@ -419,20 +278,18 @@

 	if (free_cell == NIL) {
 		gc(a, b);
-		if (free_cell == NIL)
+		if (free_cell == NIL) {
 #ifdef USE_SETJMP
-			if (!alloc_cellseg(1)) {
-				args = envir = code = dump = NIL;
-				gc(NIL, NIL);
-				if (free_cell != NIL)
-					Error("run out of cells --- rerurn to top level");
-				else
-					FatalError("run out of cells --- unable to recover cells");
-			}
+			args = envir = code = dump = NIL;
+			gc(NIL, NIL);
+			if (free_cell != NIL)
+				Error("run out of cells --- rerurn to top level");
+			else
+				FatalError("run out of cells --- unable to recover cells");
 #else
-			if (!alloc_cellseg(1))
-				FatalError("run out of cells  --- unable to recover cells");
-#endif
+			FatalError("run out of cells  --- unable to recover cells");
+#endif
+		}
 	}
 	x = free_cell;
 	free_cell = cdr(x);
@@ -622,7 +479,9 @@
 {
 	pointer x = get_consecutive_cells(3);

-	type(x) = T_DUMPSTACK;
+	type(x) = T_PAIR;
+	type(x + 1) = T_PAIR;
+	type(x + 2) = T_PAIR;
 	car(x) = NIL;
 	cdr(x) = next;
 	return x;
@@ -681,7 +540,6 @@
 void gc(register pointer a, register pointer b)
 {
 	register pointer p;
-	register short i;

 	if (gc_verbose)
 		printf("gc...");
@@ -720,18 +578,16 @@
 	clrmark(NIL);
 	fcells = 0;
 	free_cell = NIL;
-	for (i = 0; i <= last_cell_seg; i++) {
-		p = cell_seg[i] + CELL_SEGSIZE;
-		while (--p >= cell_seg[i]) {
-			if (ismark(p))
-				clrmark(p);
-			else {
-				type(p) = 0;
-				cdr(p) = free_cell;
-				car(p) = NIL;
-				free_cell = p;
-				++fcells;
-			}
+	p = cell_seg + CELL_SEGSIZE;
+	while (--p >= cell_seg) {
+		if (ismark(p))
+			clrmark(p);
+		else {
+			type(p) = 0;
+			cdr(p) = free_cell;
+			car(p) = NIL;
+			free_cell = p;
+			++fcells;
 		}
 	}

@@ -1224,7 +1080,6 @@
 	OP_QUIT,
 	OP_GC,
 	OP_GCVERB,
-	OP_NEWSEGMENT,

 	OP_RDSEXPR,
 	OP_RDLIST,
@@ -1948,14 +1803,6 @@
 		gc_verbose = (car(args) != F);
 		s_retbool(was);
 	}
-
-	case OP_NEWSEGMENT:	/* new-segment */
-		if (!isnumber(car(args))) {
-			Error_0("new-segment -- argument must be number");
-		}
-		fprintf(outfp, "allocate %d new segments\n",
-			alloc_cellseg((int) ivalue(car(args))));
-		s_return(T);

 		/* ========== reading part ========== */
 	case OP_RDSEXPR:
@@ -2319,7 +2166,6 @@
 	mk_proc(OP_GET, "get");
 	mk_proc(OP_GC, "gc");
 	mk_proc(OP_GCVERB, "gc-verbose");
-	mk_proc(OP_NEWSEGMENT, "new-segment");
 	mk_proc(OP_LIST_LENGTH, "length");	/* a.k */
 	mk_proc(OP_ASSQ, "assq");	/* a.k */
 	mk_proc(OP_PRINT_WIDTH, "print-width");	/* a.k */
@@ -2355,7 +2201,7 @@
 /* initialization of Mini-Scheme */
 void init_scheme()
 {
-	if (alloc_cellseg(FIRST_CELLSEGS) != FIRST_CELLSEGS)
+	if (alloc_cellseg() == 0)
 		FatalError("Unable to allocate initial cell segments");
 	if (!alloc_strseg(1))
 		FatalError("Unable to allocate initial string segments");


Fixed error test for non-GNU regex.

Fixed error test for non-GNU regex.

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@4211 67ed7778-7388-44ab-90cf-0a291f65f57c

--- libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c
+++ libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c
@@ -467,7 +467,7 @@
 #else
 		result = regexec (&pattern, path, 1, &match, 0);
 		regfree (&pattern);
-		if (!result) {
+		if (result) {
 			gp_log (GP_LOG_DEBUG, "gphoto2-port-info-list",
 				"regexec failed");
 			continue;


Mapped lwip buffer error to nsapi no memory error

--- features/FEATURE_LWIP/lwip-interface/lwip_stack.c
+++ features/FEATURE_LWIP/lwip-interface/lwip_stack.c
@@ -790,6 +790,7 @@
         case ERR_CLSD:
             return 0;
         case ERR_MEM:
+        case ERR_BUF:
             return NSAPI_ERROR_NO_MEMORY;
         case ERR_CONN:
         case ERR_RST:


redis: Added support for path=/unix/socket/path parameter instead of host/port.

--- src/lib-dict/dict-redis.c
+++ src/lib-dict/dict-redis.c
@@ -43,9 +43,7 @@

 struct redis_dict {
 	struct dict dict;
-	struct ip_addr ip;
 	char *username, *key_prefix;
-	unsigned int port;
 	unsigned int timeout_msecs;

 	struct ioloop *ioloop, *prev_ioloop;
@@ -271,8 +269,7 @@
 	struct redis_connection *conn = (struct redis_connection *)_conn;

 	if (!success) {
-		i_error("redis: connect(%s, %u) failed: %m",
-			net_ip2addr(&conn->dict->ip), conn->dict->port);
+		i_error("redis: connect(%s) failed: %m", _conn->name);
 	} else {
 		conn->dict->connected = TRUE;
 	}
@@ -320,7 +317,9 @@
 		const char **error_r)
 {
 	struct redis_dict *dict;
-	const char *const *args;
+	struct ip_addr ip;
+	unsigned int port = REDIS_DEFAULT_PORT;
+	const char *const *args, *unix_path = NULL;
 	int ret = 0;

 	if (redis_connections == NULL) {
@@ -330,22 +329,23 @@
 	}

 	dict = i_new(struct redis_dict, 1);
-	if (net_addr2ip("127.0.0.1", &dict->ip) < 0)
+	if (net_addr2ip("127.0.0.1", &ip) < 0)
 		i_unreached();
-	dict->port = REDIS_DEFAULT_PORT;
 	dict->timeout_msecs = REDIS_DEFAULT_LOOKUP_TIMEOUT_MSECS;
 	dict->key_prefix = i_strdup("");

 	args = t_strsplit(uri, ":");
 	for (; *args != NULL; args++) {
-		if (strncmp(*args, "host=", 5) == 0) {
-			if (net_addr2ip(*args+5, &dict->ip) < 0) {
+		if (strncmp(*args, "path=", 5) == 0) {
+			unix_path = *args + 5;
+		} else if (strncmp(*args, "host=", 5) == 0) {
+			if (net_addr2ip(*args+5, &ip) < 0) {
 				*error_r = t_strdup_printf("Invalid IP: %s",
 							   *args+5);
 				ret = -1;
 			}
 		} else if (strncmp(*args, "port=", 5) == 0) {
-			if (str_to_uint(*args+5, &dict->port) < 0) {
+			if (str_to_uint(*args+5, &port) < 0) {
 				*error_r = t_strdup_printf("Invalid port: %s",
 							   *args+5);
 				ret = -1;
@@ -370,8 +370,13 @@
 		i_free(dict);
 		return -1;
 	}
-	connection_init_client_ip(redis_connections, &dict->conn.conn,
-				  &dict->ip, dict->port);
+	if (unix_path != NULL) {
+		connection_init_client_unix(redis_connections, &dict->conn.conn,
+					    unix_path);
+	} else {
+		connection_init_client_ip(redis_connections, &dict->conn.conn,
+					  &ip, port);
+	}
 	dict->dict = *driver;
 	dict->conn.last_reply = str_new(default_pool, 256);
 	dict->conn.dict = dict;
@@ -453,8 +458,7 @@

 	if (dict->conn.conn.fd_in == -1 &&
 	    connection_client_connect(&dict->conn.conn) < 0) {
-		i_error("redis: Couldn't connect to %s:%u",
-			net_ip2addr(&dict->ip), dict->port);
+		i_error("redis: Couldn't connect to %s", dict->conn.conn.name);
 	} else {
 		to = timeout_add(dict->timeout_msecs,
 				 redis_dict_lookup_timeout, dict);
@@ -526,8 +530,8 @@

 	if (dict->conn.conn.fd_in == -1 &&
 	    connection_client_connect(&dict->conn.conn) < 0) {
-		i_error("redis: Couldn't connect to %s:%u",
-			net_ip2addr(&dict->ip), dict->port);
+		i_error("redis: Couldn't connect to %s",
+			dict->conn.conn.name);
 	} else if (!dict->connected) {
 		/* wait for connection */
 		redis_wait(dict);


INBOX in "inbox/%" style pattern wasn't compared case-insensitively.

--HG--
branch : HEAD


[src] Add error log in uthread.

[src] Add error log in uthread.

--- src/ngx_http_php_zend_uthread.c
+++ src/ngx_http_php_zend_uthread.c
@@ -781,6 +781,7 @@
     ctx = ngx_http_get_module_ctx(r, ngx_http_php_module);

     if (ctx == NULL) {
+        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "ngx_php ctx is nil at zend_uthread_create");
         return ;
     }

@@ -959,6 +960,11 @@

     ctx = ngx_http_get_module_ctx(r, ngx_http_php_module);

+    if (ctx == NULL) {
+        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "ngx_php ctx is nil at zend_uthread_exit");
+        return ;
+    }
+
     if ( ctx && ctx->generator_closure ) {
         //ngx_http_php_zend_uthread_resume(r);
         ctx->phase_status = NGX_OK;


OpenSSL from 1.1.0 is thread safe by default

Signed-off-by: Frediano Ziglio <55d48b080b2e443e395cde84d2c83b135a4ff48e@redhat.com>
Acked-by: Pavel Grunt <fbda40b445316123f12a5a6bd7556918ea74f4bc@redhat.com>

--- server/reds.c
+++ server/reds.c
@@ -2771,6 +2771,7 @@
     return (strlen(pass));
 }

+#if OPENSSL_VERSION_NUMBER < 0x1010000FL
 static unsigned long pthreads_thread_id(void)
 {
     unsigned long ret;
@@ -2808,6 +2809,11 @@
     CRYPTO_set_id_callback(pthreads_thread_id);
     CRYPTO_set_locking_callback(pthreads_locking_callback);
 }
+#else
+static inline void openssl_thread_setup(void)
+{
+}
+#endif

 static gpointer openssl_global_init(gpointer arg)
 {


O, sorry

O, sorry

--- browsers.c
+++ browsers.c
@@ -51,7 +51,7 @@
   {"Opera Mobile", "Opera"},
   {"Opera", "Opera"},
   {"OPR", "Opera"},
-  {"CPiOS", "Opera"},
+  {"OPiOS", "Opera"},
   {"Coast", "Opera"},
   {"Netscape", "Others"},
   {"Konqueror", "Others"},


hmm (file disappeared). git bug?...

hmm (file disappeared). git bug?...

--- btactst0.c
+++ btactst0.c
@@ -132,9 +132,19 @@
 	int ch, int rt, int bsz, int len)
 {
 	byte *ct;
-	int i, j, bl;
+	int i, j, k, bl, nb, isbt;

 	bl=2*bsz;
+
+	nb=(len+(bl-1))/bl;
+	isbt=0;
+
+	for(i=0; i<nb; i++)
+	{
+		j=((byte *)ibuf)[i*bsz+2];
+		if(j>88)isbt=1;
+	}
+
 	ct=obuf;

 	*ct++='R';		*ct++='I';
@@ -150,7 +160,9 @@
 	*ct++=20;		*ct++=0;
 	*ct++=0;		*ct++=0;

-	if(ch!=1)
+//	if(ch!=1)
+//	if(1)
+	if((ch!=1) || isbt)
 	{
 		*ct++=0x1C;		*ct++=0x7B;
 		*ct++=ch;		*ct++=0;
@@ -257,7 +269,10 @@
 		idx=0;
 		for(i=0; i<blks; i++)
 		{
-			BGBDT_SndBTAC1C_EncodeBlockMonoLg2(sbuf+(i*blen2),
+//			BGBDT_SndBTAC1C_EncodeBlockMonoLg2(sbuf+(i*blen2),
+//				bbuf+(i*bsz), blg2, &idx);
+
+			BGBDT_SndBTAC1C1_EncodeBlockMonoLg2(sbuf+(i*blen2),
 				bbuf+(i*bsz), blg2, &idx);
 		}


isl_scheduler.c: clarify that space of isl_sched_node is not compressed

Signed-off-by: Sven Verdoolaege <e5350bbed4977f5eb8ae1dc6abd9ae59d21ace75@kotnet.org>

--- isl_scheduler.c
+++ isl_scheduler.c
@@ -47,7 +47,8 @@

 /* Internal information about a node that is used during the construction
  * of a schedule.
- * space represents the space in which the domain lives
+ * space represents the original space in which the domain lives;
+ *	that is, the space is not affected by compression
  * sched is a matrix representation of the schedule being constructed
  *	for this node; if compressed is set, then this schedule is
  *	defined over the compressed domain space